221 JS簡單循環遍歷json數組的方法

根據這個改編https://www.cnblogs.com/wszz/p/7903784.html

如果是js循環裏面還有循環,雙層循環裏面的小循環參照下面的

var html_1 = '';
 var str = 'msgs[i].cve_return';
var xqo = eval('(' + str + ')');
for(var ii in xqo){
html_1 += '<a target="_blank" href='+xqo[ii].src+'><img style="width:80px;" src='+xqo[ii].src+'></ a>';
}

in_html += '<td>'+html_1+'</td>'; 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章