X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcore.js;h=ba5d7f5288aa0f753b82bd959afc2d4eb1893625;hb=9e06903a99caf5619d0db858ed3d24f0e6ee15db;hp=02d8269d215a3547238cbb3d7b82a68a218b54bc;hpb=7a467ed9360c2c55ea55a56e5767c9581e4f4f69;p=jquery.git diff --git a/src/core.js b/src/core.js index 02d8269..ba5d7f5 100644 --- a/src/core.js +++ b/src/core.js @@ -480,6 +480,9 @@ jQuery.extend({ if ( typeof data !== "string" || !data ) { return null; } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js @@ -796,7 +799,7 @@ function access( elems, key, value, exec, fn, pass ) { } // Getting an attribute - return length ? fn( elems[0], key ) : null; + return length ? fn( elems[0], key ) : undefined; } function now() {