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);
}
});
精彩评论