이 코드는 jsFiddle에 있습니다.Jquery UI Datepicker IE IndexOf 오류
이개체 내가 해결할 수없는 것 내 인생에 들어 속성 또는 메서드 '같이 IndexOf'
을 지원하지 않습니다 http://jsfiddle.net/crashdesk/GbUZ9/
는 오류가 발생합니다 IE7에서 문제가 나타납니다 그것.
일부 자바 스크립트 전문가가 나를 도와 줄 수 있습니까?
많은 감사, C 여기
이 코드는 jsFiddle에 있습니다.Jquery UI Datepicker IE IndexOf 오류
이개체 내가 해결할 수없는 것 내 인생에 들어 속성 또는 메서드 '같이 IndexOf'
을 지원하지 않습니다 http://jsfiddle.net/crashdesk/GbUZ9/
는 오류가 발생합니다 IE7에서 문제가 나타납니다 그것.
일부 자바 스크립트 전문가가 나를 도와 줄 수 있습니까?
많은 감사, C 여기
은 다소 해킹 방법으로 분류되었다. 나는 다른 모든 브라우저를위한 배열뿐만 아니라 IE7을위한 문자열을 만들어야 만했다.
여기에서 사용되는 정보 ... HTTP : //minimalbugs.com/questions/share-solve-javascript-error-on-ie-related-to-indexof-function
는 희망이 좀 될 것입니다 다른 사람에게 도움. 휴!
var months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
var months2 = "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec";
// initialise the "Select date" link
$('#date-pick')
.datePicker(
// associate the link with a date picker
{
createButton:false,
endDate:'31/12/2012'
}
).bind(
// when the link is clicked display the date picker
'click',
function()
{
updateSelects($(this).dpGetSelected()[0]);
$(this).dpDisplay();
return false;
}
).bind(
// when a date is selected update the SELECTs
'dateSelected',
function(e, selectedDate, $td, state)
{
updateSelects(selectedDate);
}
).bind(
'dpClosed',
function(e, selected)
{
updateSelects(selected[0]);
}
);
var updateSelects = function (selectedDate)
{
var selectedDate = new Date(selectedDate);
$('#d option[value=' + selectedDate.getDate() + ']').attr('selected', 'selected');
$('#m option[value=' + (months[selectedDate.getMonth()]) + '-' + (selectedDate.getFullYear()) + ']').attr('selected', 'selected');
}
// listen for when the selects are changed and update the picker
$('#d, #m')
.bind(
'change',
function()
{
var d = new Date(
$('#m').val().split("-")[1],
months2.indexOf($('#m').val().split("-")[0]),
$('#d').val()
);
$('#date-pick').dpSetSelected(d.asString());
}
);
// default the position of the selects to today
var today = new Date();
updateSelects(today.getTime());
// and update the datePicker to reflect it...
$('#d').trigger('change');
}
감사합니다. 그것에 대해 읽고 jsFiddle 코드와 통합을 시도했지만 여전히 오류가 발생합니다. :-( –
IE가 엉망입니다! 시도해보십시오. http://stackoverflow.com/questions/2608575/jquery-split-and-indexof-results-in-object-doesnt-support-this-property-or-me – Calum