AJAX的循环遍历对象
2018-07-26 本文已影响8人
Web的美容师
1.定义一个变量存数据
var Obj = res.data.data
2.定义一个变量放渲染数据
var html = " " ;
3.for in 循环
for (var i in Obj) {
var liStr = " < li> "
“ <div class = " bor_init " > ” + i + " 预算 " + </div> +
"<span class= " bor_span " >" + Math.floor( Obj [i] .total )+ " </sapn>" +
" </li> "
htm l+=liStr
},