i am learning JSON. i just write a simple code which is not working and also not giving any error when clicking on button. so please help me to catch the error. here is my html.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" language="javascript">
function GetJSON()
{
alert("pp");
var moviereviewtext = "{"title": "Friday the 13th", "year": 1980, "reviews":
[{"reviewer": "Pam", "stars": 3, "text": "Pretty good, but could have used more Jason"},
{"reviewer": "Alice", "stars": 4, "text": "The end was good, but a little unsettling"}]}";
var jsonobj = eval("(" + moviereviewtext + ")");
var reviewername = jsonobj.reviews[0].reviewer;
var numberstars = jsonobj.reviews[0].stars;
var reviewerthoughts = jsonobj.reviews[0].text;
alert(reviewername);
alert(numberstars);
alert(reviewerthoughts);
}
</script>
</head>
<body >
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="GetJSON();return false;" />
</form>
</body>
</html>