我正在使用jQuery fullcalendar和Grails。我之前使用的是事件(作爲json提要),當用戶單擊prev/next或更改視圖時,每次都會調用json提要URL。因爲我也需要檢查用戶會話,所以我將事件(作爲json提要)更改爲事件(如函數),如下所示。問題是它第一次工作,但下一次,ajax請求不會被髮送到服務器,IE從緩存中顯示。如果我清除瀏覽器緩存,則它會從服務器再次獲取它。jQuery fullcalendar:事件(作爲json提要)和事件(作爲函數)問題在IE
所以問題是,IE緩存事件對象。我可以知道我做錯了什麼嗎?奇怪的是,這可以在Firefox和Chrome中使用。
//events: calendarEventsURL
events: function(start, end, callback) {
$.ajax({
url: calendarEventsURL,
data: {
start: Math.round(start.getTime()/1000),
end: Math.round(end.getTime()/1000)
},
success: function(msg) {
if(msg == "no-session"){
$("#wait").html(invalidSessionMsg).fadeIn('fast',function(){
$("#wait").fadeOut(2000,function(){
window.location= "/" + $("#appName").val() + "/";
});
});
} else {
var events = [];
for(var c = 0; c < msg.length; c++){
events.push({
id: msg[c].id,
title: msg[c].title,
allDay: false,
start: msg[c].start,
end: msg[c].end
});
}
callback(events);
}
} , error: function(){
$("#wait").html(errorMsg).fadeIn('fast',function(){
});
}
});
}
謝謝非常!解決了它!完善! :) – 2010-10-18 16:09:31