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 come up with any solution.
I am reaching out this community, 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.
Yes, you can use ajaxSetup.