我试图通过这个:
[
{"leadID":"1","leadName":"Steve"},
{"leadID":"2","leadName":"Bob"},
{"leadID":"3","leadName":"Bill"},
{"leadID":"4","leadName":"Jim"},
{"leadID":"5","leadName":"James"},
{"leadID":"6","leadName":"John"},
{"leadID":"7","leadName":"Eric"},
{"leadID":"8","leadName":"Tony"},
{"leadID":"9","leadName":"Jason"},
{"leadID":"10","leadName":"Paul"}
]
我正在尝试使用 $.each 来做到这一点,但我无法做到正确。这是对控制台的测试:
$.each(JSON, function(k, v) {
console.log(v[0]);
});
我确定我只是没有正确解析 JSON,但我无法弄清楚。最终我需要将数据附加到选择输入的选项中。
对此的任何帮助都会很棒。
谢谢!