JQuery UI Tabs widget error handling

Posted by dthrasher on Stack Overflow See other posts from Stack Overflow or by dthrasher
Published on 2009-05-04T00:07:01Z Indexed on 2010/12/24 7:54 UTC
Read the original article Hit count: 199

Filed under:
|
|

When an ajax request fails, the JQuery UI Tabs widget stops responding and the "Loading..." spinner remains on the tab that caused the error.

I can get the ajax callback to give me some sort of alert message like so:

$('#localtabs > ul').tabs({ ajaxOptions: { success: tabLoadSuccessCallback, error: tabLoadFailureCallback} });

function tabLoadSuccessCallback(XMLHttpRequest, textStatus, errorThrown) {
alert("Yay!");}

function tabLoadFailureCallback(XMLHttpRequest, textStatus, errorThrown) {
alert("Could not get search results.");}

But what I'd really like is to be able to display a message within the panel, cancel the spinner, and disable the tab that caused the problem while leaving the rest of the tabs operational.

Does anyone have any ideas for how to do this?

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about jquery-ui