On Thu, Oct 22, 2009 at 04:19, Christophe <
christophe.humbert@...> wrote:
> It seems that the usual ways to dynamically load scripts (like DOM
> insert) are all asynchronous. Basically, I am looking for a function
> like getScript, outside jQuery.
var scriptLoader = document.createElement("script");
scriptLoader.src = "
http://bit.ly/jq132m";
scriptLoader.onload = scriptLoader.onreadystatechange = function () {
if (!this.readyState || "loaded" === this.readyState || "complete"
=== this.readyState) {
// replace the following line with something that properly
suits your needs
alert("jQuery " + jQuery.fn.jquery + " has loaded successfully
and is up and running!");
}
};
document.documentElement.appendChild(scriptLoader);
Hope it's what you're looking for.
--
Massimo Lombardo
Linux user #437712