jquery tabs caching to be disabled temporary for switching tab and refreshing other tab. But it reloads other tab
Initially I have enabled caching. Due Which Only One time ajax get called for each tab. After certain activity on first I am intentionally switching tab so that other tab get reloads. For which I am disabling cache:false with ajaxOptions. Which reloads the tab with new values.
But Problem come when I sw开发者_运维问答itch back to first tab it get reloads as well.
When Page load I am initializing tab with following code.
jQuery('#tabs').tabs({cache:true});
When I want to switch to other tab with new values
var $tabs = jQuery('#tabs').tabs({cache:false,ajaxOptions:{data:post_variable,type:'post'}});
$tabs.tabs('select',2);
jQuery.tabs('options','cache',true});
After this switched to tab no 2 but when i click on any other tab all get reloads.
I dont want to reload other tabs unless and untill i intentionally reloads it.
I'd think you need to set the cache to true on your #tabs element, rather than on the jQuery object.
$tabs.tabs('options','cache',true});
Also, according to this page http://docs.jquery.com/UI/Tabs#option-cache "to prevent the actual Ajax requests from being cached by the browser you need to provide an extra cache: false flag to ajaxOptions.".
精彩评论