I have a jquery ui 1.7 tab and I am trying to “abort” the request.
so I have this in my document rdy.
$.ajaxSetup(
{
'timeout': 10000,
'error': function errorCallback()
{
jAlert('The server is acting a bit slow. Your request has timed out. Please try again.', 'Server Time Out Error.');
$('#tabs').tabs('abort');
}
});
$("#tabs").tabs();
However when looking my ajax requests with firebug the requests are not terminated. They keep on running.
I see the alert box so I know it is timing out but the request still keeps on going.
Edit
I just don’t know why this is happening. Like when a tab gets loaded up it goes to my server and that method always returns a partial view. So I am not sure if is the fact that it is a partial view or not screwing up. It just seems like the request still is trying to go even though I am trying to “abort” it.
I’d suggest using the ajaxOptions to the tabs() plugin. I use this mechanism successfully.
One reason that this would be preferred can be found in the documentation for the ajaxSetup method:
If you were to supply defaults via ajaxSetup, you’d have to provide some defaults there, then other defaults with ajaxError, etc. since you are required to provide global defaults for these using the specific methods. It also restricts the application of these defaults, including aborting any tab methods, to just the tabs plugin, not affecting any other AJAX on the page.
If you were to change your error handling, it’s possible that would work as well.