Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JSON help - how to access data

Status
Not open for further replies.

unomateo

IS-IT--Management
May 9, 2006
38
0
0
US
I have a php page that encodes and array to json
Code:
$array = array("name"=>"timmy", "age"=>"34");
$str = json_encode($array);
echo $str;

how do I read the json response in javascript using onLoad?

here is the link to the json data
 
You could use eval but i would get a json parser. Are you working with any js include libraries?
 
No, I'm not using any libraries.

I'm trying to follow the yahoo developer network tutorial on JSON, but it just isn't working for me.

do you recommend any libraries?
 
I finally realized that the tutorials were not just sending the json data. They were added a function to the json data, then using the call back to read the jason data.

no library needed and so far I'm able to access data across domains... this seems to be exactly what I need
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top