I could not find a discussion on this topic so forgive me if this has been addressed.
The globalEval method uses a SCRIPT element to inject code into the document. While this accomplishes the primary goal, execution in both Firefox and Opera will be delayed if there are any remote scripts pending execution. Applications that make use of jSANP to retrieve remote data are particularly vulnerable to extremely long delays in execution of global eval'd scripts while WEbKit and IE both execute the code synchronously.
Firefox 3.6 allows setting the `async=true` attribute on dynamic scripts to circumvent the default ordered execution behavior, but this only works when the script has a SRC attribute defined. Assigning the script element a SRC attribute that contains a data:uri, instead of appending the code as a text node, works around this problem (but still does not trigger synchronous execution). WebKit seems to be unaffected by the change, synchronously executing the code as it normally does.
if ( jQuery.support.scriptEval ) {
//script.appendChild( document.createTextNode( data ) );
script.async= true;
script.src= "data:text/html," + data;
}
This page demonstrates the execution order of async scripts. In Firefox, only those with async=true
and a SRC attribute are executed ASAP while the rest execute in insertion order. IE and WK always execute ASAP and Opera always maintains insertion order.
http://digital-fulcrum.com/controljs/t/ffasync/