Skip to content
Permalink
Browse files

jquery ajax: closes #3231. The ajax setting 'dataFilter' can also par…

…se the response.
  • Loading branch information
flesler committed Aug 7, 2008
1 parent 9d9c4d2 commit bf6f7e7a63cb3d43da2fcc98c81690d2dc1ac54b
Showing with 10 additions and 6 deletions.
  1. +10 −6 src/ajax.js
@@ -480,14 +480,18 @@ jQuery.extend({
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;
},

0 comments on commit bf6f7e7

Please sign in to comment.
You can’t perform that action at this time.