If so, you can not override jQuery.getScript function.
But my test result is, IE6 and FF2 would wait to finish downloading the
script
and continue the program.
jQuery.getScript = function (src, callback) {
var js = document.createElement('SCRIPT');
js.type = 'text/javascript';
js.src = src;
js.defer = true;
document.body.appendChild(js); // IE6 and FF2 would wait to
finish downloading the script (NOT async)
if(callback) callback(js.text || js.textContent || js.innerHTML ||
""); // call the callback function
}
On 11/24/06, Andrea Ercolino <[EMAIL PROTECTED]> wrote:
沈志川 (Benx) wrote:
>
> Why not use document.createElement("script") !?
>
Because we want jQuery to wait until the script is loaded and evaluated,
so
it's possible to do something upon completion, like continuing the normal
flow of the program. This is necessary for example for writing a require
like the one in PHP.
--
View this message in context:
http://www.nabble.com/getScript-error-tf2652417.html#a7514393
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
--
Best regards,
沈志川 (Benx)
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/