Commit 4e504d86 authored by John Resig's avatar John Resig

Errors were occuring with getScript, if you called it too early.

parent 97fe63cb
...@@ -214,6 +214,7 @@ jQuery.extend({ ...@@ -214,6 +214,7 @@ jQuery.extend({
// If we're requesting a remote document // If we're requesting a remote document
// and trying to load JSON or Script // and trying to load JSON or Script
if ( !s.url.indexOf("http") && s.dataType == "script" ) { if ( !s.url.indexOf("http") && s.dataType == "script" ) {
var head = document.getElementsByTagName("head")[0];
var script = document.createElement("script"); var script = document.createElement("script");
script.src = s.url; script.src = s.url;
...@@ -228,12 +229,12 @@ jQuery.extend({ ...@@ -228,12 +229,12 @@ jQuery.extend({
done = true; done = true;
success(); success();
complete(); complete();
document.body.removeChild( script ); head.removeChild( script );
} }
}; };
} }
document.body.appendChild(script); head.appendChild(script);
// We handle everything using the script element injection // We handle everything using the script element injection
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment