admin管理员组文章数量:1291365
I am using jquery and jstree plugin to load some images when clicked on a jstree node. It looks like when I click a jstree node, it first checks the cache and if not in cache, noghting happens. I have to click the node again to load it from the server. (if the images in cache, first time click on the node works.)
So, the behavior is not consistent for the end user. The first click on the jstree node, I should go to the server to retreive the image and put it in a div. I've been looking at this for awhile now, I couldn't e up with any solution.
I am reaching out this munity, maybe someone has seen this before and can help.
$(document).ready(function() {
$("#div_tree").jstree({
"xml_data": {
"ajax": {
"url": "tree.xml"
},
"xsl": "nest"
},
"plugins": ["themes", "xml_data", "ui", "types"]
}).bind("select_node.jstree", function(event, data) {
var node_id = data.rslt.obj.attr("id");
if (node_id = "tree_a") {
$("#mydiv").html(myPic1);
}
Is there a quick way to disable jquery cache, so that everytime I click on a jstree node, I should get the images from the server.
I am using jquery and jstree plugin to load some images when clicked on a jstree node. It looks like when I click a jstree node, it first checks the cache and if not in cache, noghting happens. I have to click the node again to load it from the server. (if the images in cache, first time click on the node works.)
So, the behavior is not consistent for the end user. The first click on the jstree node, I should go to the server to retreive the image and put it in a div. I've been looking at this for awhile now, I couldn't e up with any solution.
I am reaching out this munity, maybe someone has seen this before and can help.
$(document).ready(function() {
$("#div_tree").jstree({
"xml_data": {
"ajax": {
"url": "tree.xml"
},
"xsl": "nest"
},
"plugins": ["themes", "xml_data", "ui", "types"]
}).bind("select_node.jstree", function(event, data) {
var node_id = data.rslt.obj.attr("id");
if (node_id = "tree_a") {
$("#mydiv").html(myPic1);
}
Is there a quick way to disable jquery cache, so that everytime I click on a jstree node, I should get the images from the server.
Share Improve this question edited Aug 12, 2012 at 11:42 hippietrail 17k21 gold badges109 silver badges178 bronze badges asked Jul 12, 2012 at 19:13 Mike DudeMike Dude 1512 gold badges4 silver badges16 bronze badges1 Answer
Reset to default 8Yes, you can use ajaxSetup.
$.ajaxSetup({
cache: false
});
$(document).ready(...
本文标签: javascriptdisabling cache on jqueryStack Overflow
版权声明:本文标题:javascript - disabling cache on jquery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741529208a2383652.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论