You are parsing an object. You are parsing strings, not objects; jQuery.parseJSONtakes only lines. From the documentation:
jQuery.parseJSON (json) <For> json JSON string to parse. For>
Using:
if (! window.console) {
console = {
log: function (msg) {
alert(msg);
}
};
}
console.log($.parseJSON(JSON.stringify(x, undefined, 2)));
Standard jQuery does not seem to contain string JSON. Generally, jQuery handles this for you, so this is optional. If you need it, there are different plugins.