tomermes
asked on
parsing from JSON format
given the following query:
{"ResultSet":{"version":"1 .0","Error ":0,"Error Message":" No error","Locale":"us_US","Q uality":40 ,"Found":1 ,"Results" :[{"qualit y":40,"lat itude":"37 .777125"," longitude" :"-122.419 644","offs etlat":"37 .777125"," offsetlon" :"-122.419 644","radi us":10700, "name":"", "line1":"" ,"line2":" San Francisco, CA","line3":"","line4":"Un ited States","house":"","street ":"","xstr eet":"","u nittype":" ","unit":" ","postal" :"","neigh borhood":" ","city":" San Francisco","county":"San Francisco County","state":"Californi a","countr y":"United States","countrycode":"US" ,"statecod e":"CA","c ountycode" :"","uzip" :"94102"," hash":""," woeid":248 7956,"woet ype":7}]}}
how do I get the "uzip"?
alert(data.ResultSet.Resul ts) works
but alert(data.ResultSet.Resul ts.uzip) says 'undefined'
and so does alert(data.ResultSet.Resul ts[uzip]).
thanks.
{"ResultSet":{"version":"1
how do I get the "uzip"?
alert(data.ResultSet.Resul
but alert(data.ResultSet.Resul
and so does alert(data.ResultSet.Resul
thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you want an alert, you might want to echo the JavaScript into the browser output stream. This script just echoes the data, but it would not be too hard to add the JS.
HTH, ~Ray
Open in new window