Creating JSON data using PHP and parsing it using jQuery

前端 未结 3 463
醉梦人生
醉梦人生 2020-12-21 12:45

I am using a PHP script to create JSON data. It looks like this:

{\"Id\":0}

Now if I put that into a file and then load it using ajax it\'s

3条回答
  •  一整个雨季
    2020-12-21 13:09

    use jquery's parseJSON
    e.g.

    success: function(data) {
        data = jQuery.parseJSON(data);
     $('#result').html('#Id=' + data.Id);
    }
    

提交回复
热议问题