How to parse JSON in JavaScript to take value

后端 未结 6 1252
陌清茗
陌清茗 2020-12-06 23:58

I am really stuck in parsing a JSON string and take it\'s values. I got the JSON string as

{\"user\":{\"id\":\"1\",\"firstname\":\"Freelogin\",\"created\":\         


        
6条回答
  •  我在风中等你
    2020-12-07 00:39

    You don't need jQuery, in ECMAScript5 JSON object will be supported natively and with it you can use JSON.parse method to parse a string into a JS object. IE9 will support ES5 and FF and Chrome already do.

    For the moment you can use json2.js (you can look at the source here) as fallback for the browsers that don't support JSON natively.

提交回复
热议问题