File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,8 @@ jQuery.extend({
235235
236236 // If we're requesting a remote document
237237 // and trying to load JSON or Script with a GET
238- if ( ( ! s . url . indexOf ( "http" ) || ! s . url . indexOf ( "//" ) ) && s . dataType == "script" && s . type . toLowerCase ( ) == "get" ) {
238+ if ( s . dataType == "script" && s . type . toLowerCase ( ) == "get"
239+ && jQuery . ajax . re . test ( s . url ) && jQuery . ajax . re . exec ( s . url ) [ 1 ] != location . host ) {
239240 var head = document . getElementsByTagName ( "head" ) [ 0 ] ;
240241 var script = document . createElement ( "script" ) ;
241242 script . src = s . url ;
@@ -499,3 +500,6 @@ jQuery.extend({
499500 }
500501
501502} ) ;
503+
504+ // Matches an absolute URL, and saves the domain
505+ jQuery . ajax . re = / ^ (?: \w + : ) ? \/ \/ ( [ ^ \/ ? # ] + ) / ;
You can’t perform that action at this time.
0 commit comments