How To Load jQuery UI Tabs From JSON

Published Date Author: , Posted May 4th, 2011 at 3:43:18pm

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]

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.