2012-09-17 6 views
0

안녕하세요 저는 datepicker가 IE7 또는 8에서 작동하지 않는 문제가 있습니다. Chrome 및 Firefox에서 제대로 작동하며 누군가가 문제의 원인을 밝힐 수 있습니까, 나는 상대적으로 초보자입니다. 조언이 도움이 될 것입니다. 여기에 의견이 대답하지만, 너무이 답변이 내 코드Datepicker가 IE8에서 작동하지 않습니다

<script type="text/javascript" src="jquery/jquery.js"></script> 
<link rel="stylesheet" href="jquery/themes/custom-theme/jquery.ui.all.css"> 
<script src="jquery/ui/jquery.ui.core.js"></script> 
<script src="jquery/ui/jquery.ui.widget.js"></script> 
<script src="jquery/ui/jquery.ui.datepicker.js"></script> 
<script src="jquery/ui/jquery.ui.datepicker-de.js"></script> 
<script> 
// Please add here the days you want to avoid shipping cakes, like new year, etc. 
natDays = [ 
[1, 2, 'new year'], [6, 7,], [8, 15,], [10, 26,], [11, 1,], [12, 8,], 
// [1, 26, 'au'], [2, 6, 'nz'], [3, 17, 'ie'], 
// [4, 27, 'za'], [5, 25, 'ar'], [6, 6, 'se'], 
// [7, 4, 'us'], [8, 17, 'id'], [9, 7, 'br'], 
//[10, 1, 'cn'], [11, 22, 'lb'], [12, 12, 'ke'] 
]; 

function nationalDays(date) { 
for (i = 0; i < natDays.length; i++) { 
    if (date.getMonth() == natDays[i][0] - 1 
     && date.getDate() == natDays[i][1]) { 
    return [false, natDays[i][2] + '_day']; 
    } 
} 
return [true, '']; 
} 


function noWeekendsOrHolidays(date) { 
var noWeekend = $.datepicker.noWeekends(date); 
if (noWeekend[0]) { 
    return nationalDays(date); 
} else { 
    return noWeekend; 
} 
} 


$(document).ready(function(){ 
$(function() { 
    $("#datepicker").datepicker({ 
     showOn: "button", 
     buttonImage: "jquery/calendar.gif", 
     buttonImageOnly: true, 
     gotoCurrent: true, 
     minDate: +9, 
     beforeShowDay: noWeekendsOrHolidays, 
     regional: "DE" 
    }); 
    //$("#datepicker").datepicker.regional['de']; 
}); 


$("#shipping").change(function() { 

    if($('#shipping option:selected').text() == 'Deutschland'){ 
     $("#datepicker").datepicker('option' , 'minDate' , '+9'); 
     $("#datepicker").datepicker('setDate' , null); 
    } 
    else{ 
     $("#datepicker").datepicker('option' , 'minDate' , '+4'); 
     $("#datepicker").datepicker('setDate' , null); 
    } 
}); 

// And now fire change event when the DOM is ready 
// $('#shipping').trigger('change'); 
}); 
</script> 
+2

'작동하지 않음'을 정의 하시겠습니까? 콘솔에 특정 오류 메시지가 있습니까? – raina77ow

+0

죄송합니다. Calender.gif를 클릭해도 아무 것도 나타나지 않습니다. – user1630140

+2

[12, 8] 다음에 마지막 쉼표를 제거하면 도움이됩니다 ... 배열을 올바르게 종료하지 않았습니다. –

답변

1

: 그것은 배열 뒤에 쉼표가 발생하면 중단됩니다 자바 스크립트

인터넷 익스플로러를 제거합니다.

관련 문제