$.parseJSON is working great in Firefox, Chrome, and Safari using the code below. However, in Internet Explorer 10, the script fails to yield a valid object.
Here's the jsFiddle: http://jsfiddle.net/gahathat/sq6Lb/
And the js code:
string = '{"result":"success"}';
$('#json_string').text(string);
item = $.parseJSON(string);
$('#json_result').text(item.result);
Is there a workaround for Internet Explorer that would correct this error?
This should work:
$(function() {
var string = '{"result":"success"}';
$('#json_string').text(string);
var item = $.parseJSON(string);
$('#json_result').text(item.result);
});
IE has a global object called 'item' which can't be overwritten.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With