We want all of our AJAX calls in our web app to receive JSON-encoded content. In most places this is already done (e.g. in modals) and works fine.
However, when using j
You can use the dataFilter option of the ajax call to convert your json response to the html you want to be inserted in to the panel of the tab.
Something like this:
$('#mytabs').tabs({
ajaxOptions: {
dataFilter: function(result){
var data = $.parseJSON(result);
return data.myhtml;
}
},
});
If you JSON response looked like this:
{"myhtml":"hello<\/h1>"}