Fullcalendar使用xml使用“事件(作为函数)”在IE中显示事件时出现问题

时间:2010-11-12 20:36:15

标签: fullcalendar

我知道之前有人问过,但我找不到合适的解决方案。我正在使用事件(作为函数)和.ajax。当然,除了在IE中,一切都正确显示。我正在使用FullCalendar v1.4.8和jquery-1.4.2.min.js。这是我的代码:

$('#calendar').fullCalendar({
    theme: true,
    events: function(start, end, callback) {
        var mystart = (start.getMonth() + 1)+"/"+(start.getDate())+"/"+(start.getFullYear())
        var myend = (end.getMonth() + 1)+"/"+(end.getDate())+"/"+(end.getFullYear())
        $.ajax({
            cache: false,
            type: "POST",
            url: 'calendar_data.asp',
            data: "start="+mystart+"&end="+myend+"&_rand="+Math.floor(Math.random()*100),
            error: function(xhr, type, exception) { alert("Error: " + exception); },
            success: function(doc) {
                var events = [];
                $(doc).find('event').each(function() {
                events.push({
                title: $(this).attr('title'),
                url: $(this).attr('url'),
                start: $(this).attr('start') // will be parsed
            });         
        });         
        callback(events);
        }
        });
    },
    loading: function(bool) {
        if (bool) $('#loading').show();
        else $('#loading').hide();
    },
    weekMode: 'variable',
    aspectRatio: 2,
    allDayDefault: false,
    eventClick: function(event) {
            if (event.url) {
                window.open(event.url,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400");
                return false;
            }
        },
    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,basicWeek,basicDay'
    },

});

我的xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <events><event id="396" title="Heartsaver Adult CPR and AED Course" start="11/12/2010 12:30 PM" />
    <event id="395" title="Heartsaver Adult CPR and AED Course" start="11/12/2010 8:00 AM" />
    <event id="416" title="Basketball Tournament" start="11/13/2010 8:00 AM" />
    <event id="414" title="Basketball Tournament" start="11/13/2010 9:00 AM" />
    <event id="417" title="Basketball Tournament" start="11/14/2010 8:00 AM" />
    <event id="415" title="Basketball Tournament" start="11/14/2010 9:00 AM" />
    <event id="245" title="Pediatric CPR Course" start="11/16/2010 6:30 PM" />
    <event id="397" title="Heartsaver Adult CPR and AED Course" start="11/16/2010 8:00 AM" />
    <event id="240" title="Healthcare Provider CPR Course" start="11/18/2010 6:00 PM" />
    <event id="413" title="Hockey tournament" start="11/20/2010 7:00 AM" />
    <event id="420" title="Basketball Tournament" start="11/20/2010 8:00 AM" />
    <event id="384" title="Basketball Tournament" start="11/21/2010 9:00 AM" />
    <event id="421" title="Basketball Tournament" start="11/21/2010 9:00 AM" />
    <event id="398" title="Adult First Aid Course" start="11/23/2010 8:00 AM" />
    </events>

我需要更改什么才能让事件在IE中显示?

1 个答案:

答案 0 :(得分:0)

愚蠢的问题,但我必须......

如果用简单的javascript数组替换所有AJAX内容(例如,从FullCalendar演示中获取),那么它是否可以在IE中运行?如果是这样,问题与AJAX有关,并且与FullCalendar无关。