Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery fullcalendar:IE中的事件(作为json提要)和事件(作为函数)问题_Jquery_Grails_Fullcalendar - Fatal编程技术网

jQuery fullcalendar:IE中的事件(作为json提要)和事件(作为函数)问题

jQuery fullcalendar:IE中的事件(作为json提要)和事件(作为函数)问题,jquery,grails,fullcalendar,Jquery,Grails,Fullcalendar,我将jQuery fullcalendar与Grails一起使用。我之前使用事件(作为json提要),当用户单击prev/next或更改视图时,每次都会调用json提要URL 因为我还需要检查用户会话,所以我将事件(作为json提要)更改为事件(作为函数),如下所示。问题是它第一次工作时,但下一次以后,ajax请求不会发送到服务器,IE会从缓存中显示出来。如果清除浏览器缓存,则它会再次从服务器获取缓存 所以问题是,IE正在缓存事件对象。我能知道我做错了什么吗?奇怪的是,这在Firefox和Chr

我将jQuery fullcalendar与Grails一起使用。我之前使用事件(作为json提要),当用户单击prev/next或更改视图时,每次都会调用json提要URL

因为我还需要检查用户会话,所以我将事件(作为json提要)更改为事件(作为函数),如下所示。问题是它第一次工作时,但下一次以后,ajax请求不会发送到服务器,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(){
                    });    
                  }
            });
        }
//事件:calendarEventsURL
事件:函数(开始、结束、回调){
$.ajax({
url:calendarEventsURL,
数据:{
start:Math.round(start.getTime()/1000),
end:Math.round(end.getTime()/1000)
},
成功:功能(msg){
如果(msg==“无会话”){
$(“#wait”).html(invalidSessionMsg).fadeIn('fast',function(){
$(“#等待”).fadeOut(2000,function(){
window.location=“/”+$(“#appName”).val()+“/”;
});    
});                    
}否则{
var事件=[];
对于(var c=0;c
尝试将缓存属性设置为false:

//events: calendarEventsURL            
        events: function(start, end, callback) {
            $.ajax({
                cache: false,
                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(){
                    });    
                  }
            });
        }
//事件:calendarEventsURL
事件:函数(开始、结束、回调){
$.ajax({
cache:false,
url:calendarEventsURL,
数据:{
start:Math.round(start.getTime()/1000),
end:Math.round(end.getTime()/1000)
},
成功:功能(msg){
如果(msg==“无会话”){
$(“#wait”).html(invalidSessionMsg).fadeIn('fast',function(){
$(“#等待”).fadeOut(2000,function(){
window.location=“/”+$(“#appName”).val()+“/”;
});    
});                    
}否则{
var事件=[];
对于(var c=0;c
尝试将缓存属性设置为false:

//events: calendarEventsURL            
        events: function(start, end, callback) {
            $.ajax({
                cache: false,
                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(){
                    });    
                  }
            });
        }
//事件:calendarEventsURL
事件:函数(开始、结束、回调){
$.ajax({
cache:false,
url:calendarEventsURL,
数据:{
start:Math.round(start.getTime()/1000),
end:Math.round(end.getTime()/1000)
},
成功:功能(msg){
如果(msg==“无会话”){
$(“#wait”).html(invalidSessionMsg).fadeIn('fast',function(){
$(“#等待”).fadeOut(2000,function(){
window.location=“/”+$(“#appName”).val()+“/”;
});    
});                    
}否则{
var事件=[];
对于(var c=0;c
只需在请求中发布一个随机数作为Get参数

像这样:url=
yoururl?unique=45686541654
->(唯一编号)

这样,每个请求都是唯一的


您可以查看我的回复帖子,了解类似的问题/解决方案

只需发布一个随机数,并将您的请求作为Get参数

像这样:url=
yoururl?unique=45686541654
->(唯一编号)

这样,每个请求都是唯一的