id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,blocking,blockedby
9687,"$.getScript() equiv $.ajax() with timeout - timeout elapsed, error() fired, script still executed",anonymous,anonymous,"
'''BUG: An `$.ajax()`-retrieved script is loaded/executed even after the ajax `timeout` is expired.'''

With `$.ajax({dataType: 'script', type: 'GET', timeout: 10000}, success: ..., error: ...)`, the target script, if eventually retrieved, is executed even after the timeout has elapsed and the error handler has been executed.  (That is long-hand code for `$.getScript()` with timeout and error handling added)

It should be easy enough to statically analyze for someone familiar with the `$.ajax` code.  It is too difficult a situation to create a public test case for this because of the requirements, jsfiddle.net cannot handle it.

The usecase is to connect to a [#COMET COMET] server with `$.getScript()` which works well unless a timeout is specified (with the `$.ajax({dataType: 'script'})` equivalent call) and the timeout is elapsed.  In this case of the timeout elapsing, `error()` is run (as expected), firebug shows that the browser continues to wait for a result from the server, and once retrieved, jquery executes it without respect to the `""timeout""` or `""abort""` status.

I believe the fix needs to be in `$.ajax's` `function done( status, statusText, responses, headers )` but I'm not familiar enough with this code to attempt the change.



 [=#COMET]COMET:: 
A COMET server is a special webserver implementation which holds browser connections open until an event of interest to the client occurs, at which time a payload either of code or data can be returned to the browser.  Code is preferred because it avoids the need for a parser on the client-side.",bug,closed,low,1.next,ajax,1.5.2,duplicate,,,,
