2
我正在使用jQuery datepicker。沒關係,當我從localhost在Firefox瀏覽器中運行我的項目時。過了一段時間後,當我再次刷新Firefox瀏覽器時沒有顯示jQuery datepicker。刷新頁面後jQuery日期選擇器不工作
之後我跑它鉻是好的,但再次刷新它消失了。但是,當我從其他位置(桌面)運行它,除了本地主機它的正常工作 這裏是我的.....
<div class="col-md-7 col-sm-7 col-xs-12 date-area-left">
<label class="date-label" for="username">Choose a Date : <span class="star-icon-choose">*</span></label>
<div style="width: 280px; font-family: 'Arial'; margin: auto;">
<div class="some_datepicker" style="display: block"></div>
</div>
</div>
這裏是JS ....
<script type = "text/javscript>
// Localization
jQueryDatepicker.day_names_short = {
1: 'Mon',
2: 'Tue',
3: 'Wed',
4: 'Thu',
5: 'Fri',
6: 'Sat',
7: 'Sun'
};
jQueryDatepicker.day_names = {
1: 'Monday',
2: 'Tuesday',
3: 'Wednesday',
4: 'Thursday',
5: 'Friday',
6: 'Saturday',
7: 'Sunday'
};
jQueryDatepicker.month_names = {
1: 'January',
2: 'February',
3: 'March',
4: 'Apri',
5: 'May',
6: 'June',
7: 'July',
8: 'Agust',
9: 'September',
10: 'October',
11: 'November',
12: 'December'
};
$(document).ready(function() {
var $selected = $('.selected');
$some_datepicker = $('.some_datepicker');
$some_datepicker.datepicker({
next_button: '>',
prev_button: '<'
});
$some_datepicker.setStartDate({
year: 2015,
// jquery.datepicker accepts first month as 1
// (built-in Date() class accepts first month as 0)
month: 1,
day: 3
});
$some_datepicker.on('date_selected.datepicker', function(event, date) {
$selected.show().html('Selected date is: ' + date.date.toString());
});
});
</script>
嘗試查看瀏覽器的控制檯日誌。 –
@ Shahidul伊斯蘭教你能提供工作代碼嗎? –
最初它工作,刷新後不工作,這意味着什麼都沒有顯示。 @ Himesh Aadeshara –