topical media & game development
professional-ajax-07-General-JSON-Examples-JSONExample.htm / htm
<html>
<head>
<title>JSON Example</title>
</head>
<body>
<script type="text/javascript">
var sJSON = "{\"availableColors\" : [ \"red\", \"white\", \"blue\" ],\"availableDoors\" : [ 2, 4 ]}"
var oCarInfo = eval("(" + sJSON + ")");
alert(oCarInfo.availableColors[0]); //outputs "red"
alert(oCarInfo.availableDoors[1]); //ouputs "4"
</script>
</body>
</html>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.