fullcalendar即错误

时间:2012-01-16 00:01:17

标签: jquery internet-explorer fullcalendar

我在ie8上收到一条js错误消息,它正在阻止我的网站加载。

错误消息msg是网页错误详情

User Agent: Mozilla/4.0 (compatible; MSIE 7.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; .NET4.0C; .NET4.0E; Tablet PC 2.0)
Timestamp: Sun, 15 Jan 2012 23:58:36 UTC

Message: Expected identifier, string or number
Line: 180
Char: 9
Code: 0
URI: http://realcashback.com.au/v2/system/javascript/main.js

第180行char 9是,这里是代码部分。从我的代码中的172到182

if (title) {
    calendar.fullCalendar('renderEvent',
    {
        title: title,
        start: start,
        end: end,
        allDay: allDay,

    },
    true // make the event "stick"
);

1 个答案:

答案 0 :(得分:2)

在" allDay"之后,你有一个流浪的悬空逗号。该对象文字中的属性。

IE在旧版本中并不喜欢它,但IE8应该没问题(但你不应该习惯这样做)。您是否有可能在IE7兼容模式下获得IE8?

避免这些的原因是,虽然IE8在对象文字和数组常量的属性列表末尾的逗号是可以的,但在数组的情况下,它的行为与其他浏览器不同。尾随逗号被解释为表示您希望数组中的其他元素没有值(undefined)。因为这很奇怪而且毫无用处,所以最好避免使用尾随逗号。

编辑 - 哦,我注意到你的UserAgent字符串声称它处于兼容模式。