开发者

Dojo caching issue in Spring

开发者 https://www.devze.com 2023-01-08 21:13 出处:网络
I am having an issue where dojo seems to be caching html and then not properly redisplaying it.If I call this function once it wo开发者_运维技巧rks fine, and it works on all subsequent calls if the pa

I am having an issue where dojo seems to be caching html and then not properly redisplaying it. If I call this function once it wo开发者_运维技巧rks fine, and it works on all subsequent calls if the parameters are unique. If I call it twice with duplicate parameters then essentially nothing happens. I'd appreciate any help.

 function findName(name, page){  
             var id = dojo.byId("userId");
             dojo.byId("result").innerHTML = "<b>Loading...</b>";
             dojo.xhrGet({
                url: "/test.html?pName="+name+"id="+id.value+"&page="+ page,
                load: function(data, ioargs){
                   dojo.byId("result").innerHTML = data;
                },
                error: function(error,ioargs){
                   alert(error);
                }
             }); 
          }


It doesn't look like Dojo is caching the html, but rather your browser or your web server are perhaps caching the result.

Try adding preventCache: true to your property object for dojo.xhrGet:

dojo.xhrGet({
   url: "/test.html?pName="+name+"id="+id.value+"&page="+ page,
   preventCache: true,        
   load: function(data, ioargs){
      dojo.byId("result").innerHTML = data;
   },
   error: function(error,ioargs){
      alert(error);
   }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消