Reputation: 15259
Since I upgraded to jQuery UI 1.10 something has changed. Before that upgrade, code related to my jQuery UI Tab was the following:
$('.selector').tabs({
cache: true,
ajaxOptions: {
dataType: 'html'
}
});
As wrote in the jQuery UI 1.10 Upgrade Guide, both cache
and ajaxOptions
has been removed. The guide also states to use the beforeLoad
event, but how can I upgrade the code as well?
Upvotes: 1
Views: 990
Reputation: 15259
A working approach is:
$(".selector").tabs({
beforeLoad: function (event, ui) {
if ( ui.tab.data( "loaded" ) ) {
event.preventDefault();
return;
}
ui.jqXHR.success(function() {
ui.tab.data( "loaded", true );
});
}
});
Upvotes: 3