How to Convert JSON String into JavaScript Object


You have JSON string in your code and you want to convert it into JavaScript object. You can use JQuery built in parseJSON method.

var obj = $.parseJSON('{"Name":"James Bond", "Age": "30"}');

alert(obj.Name);
alert(obj.Age);

 

 

About author


User avatar

Waqas Anwar

Founder of EzzyLearning.com, Senior Consultant, Microsoft .NET and Web Technologies

Add Comment