我试图
但是,我没有得到输出结果。
var data = {
"products": [{
"p_id": 111,
"p_name": "p_one",
"p_cost": 100
}];
};
var results = "";
for (var i = 0, i < data.products.length) {
var obj = data.products[i];
var _pid = obj.p_id;
var _pname = obj.p_name;
var _cost = obj.p_cost;
results = _pid + "." + _pname + "." + _pcost + "<br>";
}
console.log(results);
&#13;
答案 0 :(得分:1)
JavaScript 101,检查控制台是否有错误,有几个:
<wsu:Timestamp wsu:Id="TS-C5B52CA211571174C9151739434007851">
<wsu:Created>${__time(yyyy-MM-dd'T'HH:mm:ss.SSS'Z',)}</wsu:Created>
<wsu:Expires>${__timeShift(yyyy-MM-dd'T'HH:mm:ss.SSS'Z',,PT3H,,)}</wsu:Expires>
</wsu:Timestamp>
;
应为_pcost
_cost
循环:for
代替;
for JavaScript for循环,+迭代计数器丢失
,