I am trying to parse the following JSON data, but it seems that it just returns blank, I’m not sure if i am doing it right.
Could you please have a look!
$.getJSON('http://www.google.com/finance/info?infotype=infoquoteall&q=SHMN,^DJI,^IXIC,^BSESN,^SPX,^FTSE', function(data){
$('#content').html(data);
});
jsfiddle: http://jsfiddle.net/A4jKT/
First of all it won’t get the data because the URL doesn’t conform to the same origin policy, this can be fixed by adding
&callback=?to the end of the URL, this tells jQuery to treat the request as JSONP.Also instead of applying the data directly to a
divelement I alerted it instead, this appears to show the data that’s returned, you should therefore use the following jsFiddle as your new starting point.http://jsfiddle.net/A4jKT/4/