Creating Simple JSON Object with JavaScript


<html>
<head>
<title>Creating Simple JSON Object with JavaScript</title>
<style>
body {padding:80px; text-align:center;}
</style>
<script language=”javascript” >
 var JSONObj1 = { “movie”:”Chennai Express”, “year”:2013 };
 var JSONObj2 = { “movie”:”Singham Returns”, “year”:2014 };
  document.write(“<h1>Simple JSON Object</h1>”);
  document.write(“<h3>—–Movies—–</h3>”);
  document.write(“Movie-1 : “+JSONObj1.movie);
  document.write(“<br>Release Year: “+JSONObj1.year);
  document.write(“<br>”);
  document.write(“<br>Movie-2 : “+JSONObj2.movie);
  document.write(“<br>Release Year: “+JSONObj2.year);
  document.write(“<br>”);
</script>
</head>
</html>

simple json object in javascript

Regards,
Mayur Dighe
http://ImmortalDotNet.blogspot.com
http://MayurDighe.wordpress.com