]> source.dussan.org Git - jquery.git/commitdiff
Added native support for JSON data.
authorJohn Resig <jeresig@gmail.com>
Thu, 31 Aug 2006 06:32:27 +0000 (06:32 +0000)
committerJohn Resig <jeresig@gmail.com>
Thu, 31 Aug 2006 06:32:27 +0000 (06:32 +0000)
src/ajax/ajax.js

index 2864c20929bd33b65c5c893fa594babd3ee71f24..7bd392aa2374a8837713d9b711da8334142f0238 100644 (file)
@@ -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;
        },