Parsing jQuery data in JavaScript (JSON)

前端 未结 2 1734
一个人的身影
一个人的身影 2021-01-28 12:29

I am using PHP, jQuery, and JSON. Now I need to know how to parse the jQuery data in JavaScript.

load.php



        
2条回答
  •  借酒劲吻你
    2021-01-28 12:56

    You try to use a variable named json which is not defined in the scope of your function. Instead you have to use the argument named a.

    function pass(a) {
       var i;
        while(i = a.pop()) {
            alert(i.name + " " + i.distance);
        }
    }
    

提交回复
热议问题