From: John Resig Date: Thu, 31 Aug 2006 06:32:27 +0000 (+0000) Subject: Added native support for JSON data. X-Git-Tag: 1.0~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d2529835be92c7be6a970ceda95285323fd57285;p=jquery.git Added native support for JSON data. --- diff --git a/src/ajax/ajax.js b/src/ajax/ajax.js index 2864c2092..7bd392aa2 100644 --- a/src/ajax/ajax.js +++ b/src/ajax/ajax.js @@ -274,6 +274,9 @@ jQuery.extend({ // If the type is "script", eval it if ( type == "script" ) eval.call( window, data ); + // Get the JavaScript object, if JSON is used. + if ( type == "json" ) eval( "data = " + data ); + return data; },