git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
jquery ajax: closes #2842.
[jquery.git]
/
src
/
ajax.js
diff --git
a/src/ajax.js
b/src/ajax.js
index
244397f
..
bf6c464
100644
(file)
--- a/
src/ajax.js
+++ b/
src/ajax.js
@@
-141,6
+141,7
@@
jQuery.extend({
},
ajaxSettings: {
},
ajaxSettings: {
+ url: location.href,
global: true,
type: "GET",
timeout: 0,
global: true,
type: "GET",
timeout: 0,
@@
-233,9
+234,13
@@
jQuery.extend({
if ( s.global && ! jQuery.active++ )
jQuery.event.trigger( "ajaxStart" );
if ( s.global && ! jQuery.active++ )
jQuery.event.trigger( "ajaxStart" );
+ // Matches an absolute URL, and saves the domain
+ var remote = /^(?:\w+:)?\/\/([^\/?#]+)/;
+
// If we're requesting a remote document
// and trying to load JSON or Script with a GET
// If we're requesting a remote document
// and trying to load JSON or Script with a GET
- if ( (!s.url.indexOf("http") || !s.url.indexOf("//")) && s.dataType == "script" && s.type.toLowerCase() == "get" ) {
+ if ( s.dataType == "script" && s.type.toLowerCase() == "get"
+ && remote.test(s.url) && remote.exec(s.url)[1] != location.host ){
var head = document.getElementsByTagName("head")[0];
var script = document.createElement("script");
script.src = s.url;
var head = document.getElementsByTagName("head")[0];
var script = document.createElement("script");
script.src = s.url;