how to read json result in jquery?

前端 未结 4 1216
忘掉有多难
忘掉有多难 2020-11-27 22:43

I\'m not familiar with jquery. Will you please help me in this? I have a json respone from url but i don\'t know how, can i read key value in jquery.

For ex

4条回答
  •  情深已故
    2020-11-27 23:14

    You don't have to read json with jquery in general .

    Just read it with ease , using JSON.parse() function and without Jquery .

    var json = '{"result":true,"count":1}',
        obj = JSON.parse(json);
    
    alert(obj.count);
    

提交回复
热议问题