Searching...
Friday, 28 June 2013

Creating simple Json objects in Javascript example

10:37


Here is one example to create JSON object in java script

<html>
<head>
<title>Creating json object</title>
<script language="javascript" >
var jsonObject = {"address":"Bangalore","designation":"Open source Publisher","employer":"Self Business","name":"Vinod"}
document.write("<h1>JSON Object Details</h1>");
document.write("<br>");
document.write("<h3>name="+jsonObject.name+"</h3>");
document.write("<h3>Address="+jsonObject.address+"</h3>");
document.write("<h3>designation="+jsonObject.designation+"</h3>");
document.write("<h3>employer="+jsonObject.employer+"</h3>");
</script>
</head>
<body>
</body>
</html>
Output

0 comments: