1

我试图让 jQuery fullcalendar 在 IE9 中工作。到目前为止,它在 Firefox 和 Chrome 中运行良好。我 100% 确定我在任何对象的末尾都没有逗号。

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"
    }
]

这是我的代码:

$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(){

                }
            }
        }
    )
);

现在这是我根本没有得到的东西。当我将事件对象设置为 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"}]
        }
    )
);

有什么想法可能是错的吗?我不知道在哪里继续搜索......

4

2 回答 2

0

我一直在使用带有 IE9 的 Fullcalendar v1.5.4 并且事件不会出现在日历上(ajax 源)。但是由于一些我不太明白的奇怪原因,打开开发工具栏(F12)然后刷新页面会使事件出现。

这可以用作临时修复。

于 2014-11-03T02:06:32.170 回答
0

确保将响应内容类型设置为

application/json

编辑

我认为选项对象结构不正确
替换这个

    $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
     }
 }

有了这个

$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
}
于 2012-08-06T09:27:03.167 回答