php and nested json: how can i access this element?

前端 未结 3 1714
迷失自我
迷失自我 2021-01-02 07:51

Here\'s the json text:

{
\"data\": {
    \"current_condition\": [{
        \"cloudcover\": \"75\",
        \"humidity\": \"63\",
        \"observation_time\"         


        
3条回答
  •  甜味超标
    2021-01-02 08:36

    You can use json to retrieve json result to a variable and then use variable information to display in js.

    $.ajax({
        'type': 'GET',
        'url': 'abc.com,
        'dataType': 'json',
        success: function (data) {
    
        var response = data;
        // alert(response.data.current_condition)  //something like that
        // for (var i = 0; i < response.length; i++) { }
    
        }
    

提交回复
热议问题