48
rated 0 times
[
54]
[
6]
/ answers: 1 / hits: 15987
/ 15 Years ago, mon, december 7, 2009, 12:00:00
I am retrieving JSON using jQuery's getJSON call.
My problem is that some of the fields in the returned JSON have spaces in them.
How do I retrieve these values from the JSON without changing the source data? See line marked ERROR below:
$.getJSON(url, null, function(objData) {
$.each(objData.data, function(i, item) {
var zip = item.Zip;
var fname = item.First Name; //ERROR
});
});
Example JSON:
jsonp123456789({data:[{Zip:12345,First Name:Bob},{Zip:23456,First Name:Joe},{Zip:34567,First Name:Bill}]})
Thanks
More From » jquery