[英]jQuery fullcalendar not showing events in IE9
I'm trying to get jQuery fullcalendar work in IE9. 我正在尝试使IE9中的jQuery fullcalendar工作。 So far it's working perfectly in Firefox and Chrome.
到目前为止,它在Firefox和Chrome中都能正常运行。 I'm 100% sure I don't have any commas at the end of any object.
我100%确保在任何对象的末尾都没有逗号。
IE's developer console isn't showing any errors, completes the request and shows exactly the same JSON response as FF/Chrome (multi-line-formatted for readability): IE的开发人员控制台未显示任何错误,未完成请求,并显示与FF / Chrome完全相同的JSON响应(出于可读性考虑采用多行格式):
[
{
"beschreibung":"",
"end":"2012-07-05 19:00:00",
"username":"dm",
"ort":"hier",
"allDay":"",
"id":"763-1340202369",
"title":"termin für den nächsten monat",
"start":"2012-07-05 17:00:00"
},{
"beschreibung":"dfgsfdg",
"end":"2012-07-31 12:00:00",
"username":"dm",
"ort":"",
"allDay":"",
"id":"UBePvX8AAQEAACyIg",
"title":"termin für heute",
"start":"2012-07-31 10:00:00"
}
]
Here's my code: 这是我的代码:
$o = {
calOptions: { unselectCancel:'.calEdit', theme: true, buttonText: { today:'Heute', month:'Monat', week:'Woche', day:'Tag' }, monthNames: ['Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'], dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], timeFormat: 'H(:mm)', axisFormat: 'H(:mm):00', header: { left:'prev,next today', center:'title', right:'month,agendaWeek,agendaDay' }, editable: true, allDayText: 'Ganztägig', firstDay: 1, firstHour: 8, allDaySlot: false, allDayDefault:false }
}
$('#db .fullCalendar').fullCalendar(
$.extend(
$o.calOptions, {
events: {
url: 'c.pl',
type: 'POST',
data: {
j: 'json',
x: 'c'
},
error: function(){
}
}
}
)
);
Now here's the thing I don't get at all. 现在这是我一无所知的事情。 When I set the events object to the JSON-response, IE9 can display them:
当我将事件对象设置为JSON响应时,IE9可以显示它们:
$('#db .fullCalendar').fullCalendar(
$.extend(
$o.calOptions, {
events: [{"beschreibung":"","end":"2012-07-05 19:00:00","username":"dm","ort":"hier","allDay":"","id":"763-1340202369","title":"termin für den nächsten monat","start":"2012-07-05 17:00:00"},{"beschreibung":"dfgsfdg","end":"2012-07-31 12:00:00","username":"dm","ort":"","allDay":"","id":"UBePvX8AAQEAACyIg","title":"termin für heute","start":"2012-07-31 10:00:00"}]
}
)
);
Any ideas what could be wrong? 任何想法可能有什么问题吗? I don't know where to continue searching...
我不知道在哪里继续搜寻...
Make sure you set the response content type to 确保将响应内容类型设置为
application/json
Edit 编辑
I think the options object structure is not correct 我认为选项对象结构不正确
Replace this 取代这个
$o = {
calOptions: {
unselectCancel: '.calEdit',
theme: true,
buttonText: {
today: 'Heute',
month: 'Monat',
week: 'Woche',
day: 'Tag'
},
monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
dayNamesShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
timeFormat: 'H(:mm)',
axisFormat: 'H(:mm):00',
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
allDayText: 'Ganztägig',
firstDay: 1,
firstHour: 8,
allDaySlot: false,
allDayDefault: false
}
}
With this 有了这个
$o = {
unselectCancel: '.calEdit',
theme: true,
buttonText: {
today: 'Heute',
month: 'Monat',
week: 'Woche',
day: 'Tag'
},
monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
dayNamesShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
timeFormat: 'H(:mm)',
axisFormat: 'H(:mm):00',
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
allDayText: 'Ganztägig',
firstDay: 1,
firstHour: 8,
allDaySlot: false,
allDayDefault: false
}
I've been using Fullcalendar v1.5.4 with IE9 and the events would not appear on the calendar (ajax source). 我一直在使用Fullcalendar v1.5.4和IE9,并且事件不会出现在日历上(ajax源)。 But for some odd reason that I don't really understand, opening the developper toolbar (F12) and then refreshing the page makes the events appear.
但是由于某种我不太了解的奇怪原因,打开开发人员工具栏(F12),然后刷新页面会使事件出现。
This can be used as a temporary fix. 这可以用作临时修补程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.