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 2864c20..7bd392a 100644 (file)
@@ -274,6 +274,9 @@ jQuery.extend({
                // If the type is "script", eval it
                if ( type == "script" ) eval.call( window, data );
 
                // 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;
        },
        
                return data;
        },