问题描述
jQuery.Deferred异常:无法读取属性'clone'的null TypeError :无法读取位于_fetchEventSource(source,callback)循环中的属性'clone'null
)方法:
$ b $ pre> for(i = 0; i res = fetchers [i] .call(
t,//这是日历对象
源,
rangeStart.clone(),// rangeStart未定义
rangeEnd.clone(),
options.timezone,
回调
);
问题是rangeStart未设置。但是,如果我使用默认标题中的按钮将月视图更改为星期视图,并再次返回,则会加载事件。
我找不到为什么rangeStart最初没有被设置,但是如果我切换视图,设置得很好。
为了完整起见,我的JS调用日历:
$('。event-calendar')。fullCalendar({
header:{
left:'prev,next今天',
center:'title',
right:'month,basicWeek,basicDay'
},
eventLimit:true,
events:{
url:'/ events / json',
color:'#0060db',
textColor:'white'
}
});
这是与最新的JQuery 3兼容的问题。我可以没有帮助,但如果你想让FullCallendar工作,你应该暂时将你的JQuery转换为2.x或1.x行并等待FullCalendar更新。
In my console, I get this error:
jQuery.Deferred exception: Cannot read property 'clone' of null TypeError: Cannot read property 'clone' of null
which is in this loop in the _fetchEventSource(source, callback) method:
for (i = 0; i < fetchers.length; i++) {
res = fetchers[i].call(
t, // this, the Calendar object
source,
rangeStart.clone(), // rangeStart is undefined
rangeEnd.clone(),
options.timezone,
callback
);
The problem is that rangeStart is not set. However, if I use the buttons in the default header to change from "month" view to "week" view, and back again, the events load.
I can't figure out why rangeStart isn't being set initially but gets set just fine if I switch the view.
For the sake of completeness, here's my JS to call the calendar:
$('.event-calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
eventLimit: true,
events: {
url: '/events/json',
color: '#0060db',
textColor: 'white'
}
});
This is compatible problem with newest JQuery 3. I can't help but if you want to get working FullCallendar you should temporary reverse your JQuery to 2.x or 1.x line and wait for FullCalendar update.
这篇关于FullCalendar-2.7.3事件在初始加载时不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!