Welcome Guest. Sign in or Signup

1 Comments

How to convert a JSON string to an object?

Asked by: 1684 views
b) JSON

0
0

jQuery has a parseJSON method that does this JSON string to object conversion. Like this:

var myJSONObj = $.parseJSON(myJSONString);

However, JSON.parse API below provides you more flexibility in controling how individual items are converted to objects.

var myJSONObj = window.JSON.parse(jsonString, fnConverter);

This is elaborated in more detail in this JSON in JavaScript topic.

1 Comments



  1. fishinglovers on Dec 19, 2014 Reply

    I think this is a real great blog.Thanks Again. Much obliged.


Comments on Question