ajax 响应 我收到了响应,并提醒它显示的响应 [object Object]。 然后我这样做,
var Str = JSON.stringify(response);
然后我提醒
alert(Str);
然后我得到了
[{"m_Code":1054,"m_Name":"Vijay"}]
现在我想绑定(bind)html选择框中的值
<select><option value = "1054">Vijay</option></select>
我该怎么做?请帮助我
最佳答案
循环响应
var str="<select>";
for (i=0; i<response.length; i++) {
str +="<option value='"+response.d[i].m_Code+"'>"+response.d[i].m_Name+"</option>"
}
str +="</select>";
关于javascript - 我得到的 ajax 响应 [object Object],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27898762/