How To Load jQuery UI Tabs From JSON
Use the “dataFilter” Ajax option given the following server reply:
{ status: 17, result: “You are not logged in” }
[code]
var $tabs = jQuery(‘#menutabs’).tabs({
ajaxOptions: {
dataFilter: function(server_json_reply){
var data = jQuery.parseJSON(server_json_reply);
if (data.status == 17) {
alert(‘Your session has timed out and you have been logged off.’);
window.location = “/”;
}
return data.result;
},
},
cookie: {
name: ‘tab_cookie’,
expires: 1
},
load: function(event, ui) {
liveLoader(event, ui);
}
});
[/code]
Leave Your Comment
All fields marked with "*" are required.