“Object not supported” Javascript error trying to access FullCalendar

人盡茶涼 提交于 2019-11-29 05:37:01

问题


. .

I walked in this morning to find out that a calendar, implemented using FullCalendar and a public Google feed, is no longer working. The calendar does not appear, and it gives me a Javascript error.

The Javascript error I'm getting is:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; Tablet PC 2.0; .NET4.0C; .NET4.0E)
Timestamp: Mon, 13 Aug 2012 14:59:47 UTC


Message: Object doesn't support this property or method
Line: 43
Char: 271
Code: 0
URI: http://[removed for security purposes]/fullcalendar/fullcalendar.min.js

The original script code looked something like this:

        $('#calendar').fullCalendar({
            editable: false,
            events: '[Google feed removed for security]',
            className: 'gcal-event',
            eventClick: function (calEvent, jsEvent, view) {
                return false
                }
            });

(Disclaimer: I am not the original author of this code.)

This function used to work, and I haven't touched anything (other than trying out code to debug it -- which gives me the exact same error). I'm trying to figure out what's changed.

To be honest, I don't think it's the Google data feed. Reason: I copy/pasted the code from http://arshaw.com/fullcalendar/ (for testing purposes), and I got the identical Javascript error. Also, I tried going into the data feed URI, and it seems to come up fine.

The problem is not browser-specific; this problem appears regardless of whether I use IE, FF, Safari, Opera, etc.

It also doesn't appear to be user-specific; I've heard from at least two other users saying they have the same problem.

I'm running FullCalendar v1.5.3.

Has anyone else come across this?


回答1:


I think i got a way better answer :)

In fact is the curCSS function that has been removed with jQuery 1.8, it's actually been deprecated since 1.3.

The solution is to use css instead, so do a search & replace into the plugin replacing "curCSS" by "css"

And it will be all fine!

http://bugs.jquery.com/ticket/11787




回答2:


Got it.

Apparently, it doesn't like the latest version of JQuery.

The script source is set to point to http://code.jquery.com/jquery-latest.min.js. Just for grins, I pointed it to the jquery-1.7.1.min.js that came with the FullCalendar code.

Lo and behold, it came right up.

Edit: I updated the references to appear as they do in the FullCalendar example, i.e.:

<script type='text/javascript' src='/js/fullcalendar-1.5.3/jquery/jquery-1.7.1.min.js'></script>
<script type='text/javascript' src='/js/fullcalendar-1.5.3/jquery/jquery-ui-1.8.17.custom.min.js'></script>



回答3:


As curCSS was an alias for css you can add the code below to go around that issue.

if(!$.curCSS) 
    $.curCSS = $.css;


来源:https://stackoverflow.com/questions/11938801/object-not-supported-javascript-error-trying-to-access-fullcalendar

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