Wednesday, January 8, 2014

How to convert a string to json array in Javascript?

By JQuery:
var initQuestions = '[{ "Title": "1112", "QuestionType": { "ID": 2, "Value": "1", "Text": "Text", "Selected": true}}]';
var json = $.parseJSON( initQuestions );

Reference:
http://api.jquery.com/jquery.parsejson/


No comments:

Post a Comment