.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> JQuery >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

JSON Parsing

Posted By:Akhil Raj       Posted Date: January 30, 2014    Points: 40    Category: JQuery    URL: http://www.dotnetspark.com  

Generally developers confused with JSON data. Here i explained raw data is parsed to json object in jquery.
 

The following is the example of raw data serialized as json
[{\"Name\":\"Name1\",\"Age\":20},{\"Name\":\"Name2\",\"Age\":23},{\"Name\":\"Name3\",\"Age\":28}]";
But actually if you see this, this is not a valid json. You need to parse as json object.

To validate json you can use this site : http://jsonlint.com/

So in jquery you need to parse the raw data and code is below:

var data = JSON.parse(jsonData);


     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend