git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replaced all x.constructor == String comparsions with typeof x == "string"
[jquery.git]
/
src
/
ajax
/
ajax.js
diff --git
a/src/ajax/ajax.js
b/src/ajax/ajax.js
index
e5a3854
..
f0f448a
100644
(file)
--- a/
src/ajax/ajax.js
+++ b/
src/ajax/ajax.js
@@
-122,9
+122,10
@@
jQuery.fn.extend({
return this.find('script').each(function(){
if ( this.src )
// for some weird reason, it doesn't work if the callback is ommited
return this.find('script').each(function(){
if ( this.src )
// for some weird reason, it doesn't work if the callback is ommited
- jQuery.getScript( this.src, function() {} );
- else
- eval.call( window, this.text || this.textContent || this.innerHTML || "" );
+ jQuery.getScript( this.src );
+ else {
+ jQuery.eval ( this.text || this.textContent || this.innerHTML || "" );
+ }
}).end();
}
}).end();
}
@@
-581,9
+582,12
@@
jQuery.extend({
if ( s.ifModified && modRes )
jQuery.lastModified[s.url] = modRes;
if ( s.ifModified && modRes )
jQuery.lastModified[s.url] = modRes;
- // If a local callback was specified, fire it
+ // process the data (runs the xml through httpData regardless of callback)
+ var data = jQuery.httpData( xml, s.dataType );
+
+ // If a local callback was specified, fire it and pass it the data
if ( s.success )
if ( s.success )
- s.success( jQuery.httpData( xml, s.dataType ), status );
+ s.success( data, status );
// Fire the global callback
if( s.global )
// Fire the global callback
if( s.global )
@@
-678,8
+682,10
@@
jQuery.extend({
var data = !type && ct && ct.indexOf("xml") >= 0;
data = type == "xml" || data ? r.responseXML : r.responseText;
var data = !type && ct && ct.indexOf("xml") >= 0;
data = type == "xml" || data ? r.responseXML : r.responseText;
- // If the type is "script", eval it
- if ( type == "script" ) eval.call( window, data );
+ // If the type is "script", eval it in global context
+ if ( type == "script" ) {
+ jQuery.eval( data );
+ }
// Get the JavaScript object, if JSON is used.
if ( type == "json" ) eval( "data = " + data );
// Get the JavaScript object, if JSON is used.
if ( type == "json" ) eval( "data = " + data );
@@
-719,6
+725,14
@@
jQuery.extend({
// Return the resulting serialization
return s.join("&");
// Return the resulting serialization
return s.join("&");
+ },
+
+ // TODO document me
+ eval: function(data) {
+ if (window.execScript)
+ window.execScript( data );
+ else
+ eval.call( window, data );
}
});
}
});