aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2012-12-02 00:14:25 -0500
committerRichard Gibson <richard.gibson@gmail.com>2013-04-17 11:27:57 -0400
commit03db1ada2cc223edf545c5a452e55062647837fa (patch)
treeaa52937506bfd8e8fcad54bd9a91030d27ae6eec /src/manipulation.js
parentea5c22ec12e6a548b1ec2d7b0dcd9f71bea8d5dd (diff)
downloadjquery-03db1ada2cc223edf545c5a452e55062647837fa.tar.gz
jquery-03db1ada2cc223edf545c5a452e55062647837fa.zip
Fix #12838: hook point for non-jQuery.ajax synchronous script fetch/execute in domManip. Close gh-1051.
Diffstat (limited to 'src/manipulation.js')
-rw-r--r--src/manipulation.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index 640dfcd6f..f37ec421a 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -256,14 +256,7 @@ jQuery.fn.extend({
if ( node.src ) {
// Hope ajax is available...
- jQuery.ajax({
- url: node.src,
- type: "GET",
- dataType: "script",
- async: false,
- global: false,
- "throws": true
- });
+ jQuery._evalUrl( node.src );
} else {
jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
}
@@ -465,6 +458,17 @@ jQuery.extend({
data_user.discard( elem );
data_priv.discard( elem );
}
+ },
+
+ _evalUrl: function( url ) {
+ return jQuery.ajax({
+ url: url,
+ type: "GET",
+ dataType: "text",
+ async: false,
+ global: false,
+ success: jQuery.globalEval
+ });
}
});