'{' +
'"artist" :"Phish", ' +
'"title" : "A Picture of Nectar", ' +
'"releaseYear" : 1992,' +
'"tracks" : [' +
' "Llama",' +
' "Eliza",' +
']' +
'}';
function pageLoad()
{
var album = eval("("+ JSONstring +")")
var innerHTML = album.artist;
alert(innerHTML)
$get('placeholder').innerHTML = innerHTML;
var track = "";
for(var i =0; i
track += "track #" + i + " = " + album.tracks[i]+ "
";
}
$get('placeholder2').innerHTML = track;
}
1 comment:
http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=11
simple examples about json
Post a Comment