如何分别回显回调的JSON数组项?

时间:2016-04-09 13:11:24

标签: php jquery mysql json

这是我的回调,其中数组的第一项是title,第二项是button

jQuery21306342411266173318_1460205778290([["I see you like this Mazda, don't you?","OK, give more info!"]])

在前端我使用它,它向我展示了两个项目。如何分别获得第一个(title)和第二个(button)?

function showPopup(data) { 
console.log(data[0]);
}

function alert(){
      $.getJSON("handler.php?type=alert&callback=?&cookie="+ y, showPopup);
}

0 个答案:

没有答案