mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Errors were occuring with getScript, if you called it too early.
This commit is contained in:
@@ -214,6 +214,7 @@ jQuery.extend({
|
||||
// Watch for a new set of requests
|
||||
if ( s.global && ! jQuery.active++ )
|
||||
jQuery.event.trigger( "ajaxStart" );
|
||||
|
||||
// If we're requesting a remote document
|
||||
// and trying to load JSON or Script
|
||||
if ( !s.url.indexOf("http") && s.dataType == "script" ) {
|
||||
@@ -228,12 +229,12 @@ jQuery.extend({
|
||||
// Attach handlers for all browsers
|
||||
script.onload = script.onreadystatechange = function(){
|
||||
if ( !done && (!this.readyState ||
|
||||
this.readyState == "loaded" || this.readyState == "complete") ) {
|
||||
this.readyState == "loaded" || this.readyState == "complete") ) {
|
||||
done = true;
|
||||
success();
|
||||
complete();
|
||||
head.removeChild( script );
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user