User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:126.96.36.199) Gecko/20070725 Firefox/188.8.131.52
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:184.108.40.206) Gecko/20070725 Firefox/220.127.116.11
In general, scripts that have been removed from the DOM before they have been loaded by the browser should not be executed.
A script element with a src attribute is attached to the head element after the page loads. If that script element is removed from the DOM before the script source is processed by the browser, the browser will still execute the script source.
This causes problems with JSONP APIs (http://ajaxian.com/archives/jsonp-json-with-padding), where the callback specified in the script source may not exist once the script tag is removed.
This issue comes up if a JSONP API took a long time to respond, but the web page decided not to wait for it to complete. The web page may decide to remove the script tag and try the request again using some different parameters.
Steps to Reproduce:
1. Go to test URL above.
3. If you have Firebug installed, you should see a "TEST OK. No errors should be seen after this timeout error." in the console. If no Firebug, the in-document Firebug lite should report the same thing.
After about 5 seconds, there will be an error in the Firebug console: "dojo.io.script.jsonp_dojoIoScript1 has no properties"
Also, if you click on the "Test for SuperXFooBarVariable". It will show an "Oh no" message because a global script variable named SuperXFooBarVariable was defined in the script source for the script element that was removed.
There should be no "dojo.io.script.jsonp_dojoIoScript1 has no properties" error after 5 seconds (or when the response for timeout.php is received). Also, after the 5 seconds, clicking on the "Test for SuperXFooBarVariable" variable should return something like "undefined".
Tested the above page with all Add-Ons turned off, and the issue still occurred.
This is a mass search for bugs that are in the Firefox General component, are
UNCO, and have not been changed for 800 days and have an unspecified version.
Reporter, can you please update to Firefox 3.6.10, create a fresh profile,
http://support.mozilla.com/en-US/kb/managing+profiles, and test again. If you
still see the bug, please update this bug. If the issue is gone, please set the
resolution to RESOLVED > WORKSFORME.
No reply from reporter, INCOMPLETE. Please retest with Firefox 3.6.12 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
I am not the original bug reporter, but I've tested with FF 5.0.1 and just today with 8.0.1 on Mac OS X (Intel) and the bug is still present and should be reopened as unresolved.
Details of the problems along with testcases can be found here: http://archive.dojotoolkit.org/nightly/dojotoolkit/dojo/tests/io/scriptTimeout.html and here: http://bugs.jquery.com/ticket/8744
the basic problem is that FF does not cancel script loading after a script got removed from the DOM. This is, however, important as for JSONP requests a timeout may be set after which loading of the script is not necessary and will result in an "unknown function" error in FF if the callback has been freed in the meantime.
Bug 707154 was filed as a followup to comment 3. Forward-dupping this, since that bug is clearer at this point....
*** This bug has been marked as a duplicate of bug 707154 ***