git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A test was using the old / child selector syntax - updating to the new style.
[jquery.git]
/
src
/
ajax.js
diff --git
a/src/ajax.js
b/src/ajax.js
index
a5ee4b7
..
e454533
100644
(file)
--- a/
src/ajax.js
+++ b/
src/ajax.js
@@
-12,8
+12,6
@@
jQuery.fn.extend({
url = url.slice(0, off);
}
url = url.slice(0, off);
}
- callback = callback || function(){};
-
// Default to a GET request
var type = "GET";
// Default to a GET request
var type = "GET";
@@
-56,7
+54,8
@@
jQuery.fn.extend({
// If not, just inject the full result
res.responseText );
// If not, just inject the full result
res.responseText );
- self.each( callback, [res.responseText, status, res] );
+ if( callback )
+ self.each( callback, [res.responseText, status, res] );
}
});
return this;
}
});
return this;
@@
-67,8
+66,7
@@
jQuery.fn.extend({
},
serializeArray: function() {
return this.map(function(){
},
serializeArray: function() {
return this.map(function(){
- return jQuery.nodeName(this, "form") ?
- jQuery.makeArray(this.elements) : this;
+ return this.elements ? jQuery.makeArray(this.elements) : this;
})
.filter(function(){
return this.name && !this.disabled &&
})
.filter(function(){
return this.name && !this.disabled &&
@@
-480,14
+478,18
@@
jQuery.extend({
if( s && s.dataFilter )
data = s.dataFilter( data, type );
if( s && s.dataFilter )
data = s.dataFilter( data, type );
- // If the type is "script", eval it in global context
- if ( type == "script" )
- jQuery.globalEval( data );
+ // The filter can actually parse the response
+ if( typeof data == 'string' ){
- // Get the JavaScript object, if JSON is used.
- if ( type == "json" )
- data = eval("(" + data + ")");
+ // If the type is "script", eval it in global context
+ if ( type == "script" )
+ jQuery.globalEval( data );
+ // Get the JavaScript object, if JSON is used.
+ if ( type == "json" )
+ data = eval("(" + data + ")");
+ }
+
return data;
},
return data;
},