Wednesday, 21 August 2013

no json from array in javascript

no json from array in javascript

The below code is intended to return json object from arraylist but it is
not showing alert. there is no js error...
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="json.js" />
<script type="text/javascript" src="json2.js" />
<script type="text/javascript">
var my_info= {};
my_info["john"]="1a";
my_info["joseph"]="2b";
my_info["helen"]="3c";
var val = JSON.stringify(my_info);
alert(val);
</script>
</head>
<body>
</body>
</html>

No comments:

Post a Comment