FullCalendar not loading from JSON except in Chrome

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 13:18:18

问题


I am using FullCalendar to make a theater-rehearsal schedule, and decided JSON was the best way to pull events from my MySQL database. In the JavaScript for the calendar page, I'm doing:

$(document).ready(function() {
$('#calendar').fullCalendar({
events: '/eventsfeed.php',
[...]

And my JSON feed is returning this, with the header "Content-type: application/json":

[
    {
        "title" : "First Show",
        "start" : "2012-04-26 19:00:00 EST",
        "end" : "2012-04-26 21:00:00 EST",
        "allDay" : 0,
        "comments" : "Good show everyone!",
        "scenes" : "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50",
        "id" : "1",
        "location" : "place",
        "userid" : "1"
    },
    {
        "title" : "derp",
        "start" : "2012-01-21 13:59:59 EST",
        "end" : "2012-01-21 23:59:59 EST",
        "allDay" : 0,
        "comments" : "test event",
        "scenes" : "1,16,24",
        "id" : "2",
        "location" : "narnia",
        "userid" : "1"
    }
]

Now, this works just fine in Chrome, but none of my events show up in Firefox or Safari, and they used to show up when I was adding the events as a Javascript array. I tried declaring the JSON feed in a way where an alert() would be thrown if AJAX failed while retrieving the JSON feed, but it never did anything. I checked that Javascript is enabled in the browsers, and I tried changing the JSON feed's content-type to text/html and text/plain, but still had no luck. What am I missing here? Thanks!


回答1:


Ah, I found it, the EST in the dates was breaking everything. FullCalendar's documentation said that would be fine, but I guess it was wrong. (Originally posted this as a comment on 2012/01/26)



来源:https://stackoverflow.com/questions/9021481/fullcalendar-not-loading-from-json-except-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!