error function not triggered when using $.ajax() to load an external script
Hi,
I'm using $.ajax() to load an external script, to get the latest updates from a twitter user. I'm using this so that Twitter downtime doesn't affect my site, because if I hardcode this in the HTML, my document.ready function halts or errors if/while twitter is down.
The problem is I can't get the error function to trigger when the loading fails. This is what I'm using:
-
$.ajax({
-
url: twitter_url ,
-
timeout: 20000,
-
dataType: 'script',
-
success: twitter_LoadSuccess,
-
error: twitter_LoadError,
-
complete: twitter_LoadComplete
-
});
Both "twitter_LoadSuccess" and "twitter_LoadComplete" are executed, but twitter_LoadError never gets triggered, even when the script is not loaded.
Any idea why?
Thanks