控制器未进入for循环:javascript
我用javascript写了一段代码,如下所示控制器未进入for循环:javascript,javascript,Javascript,我用javascript写了一段代码,如下所示 alert(attributes.length); for(temp=0;temp<attributes.lenth;temp++){ attribute_list+="<option value='"+attributes[temp]+"'>"+attributes[temp]+
alert(attributes.length);
for(temp=0;temp<attributes.lenth;temp++){
attribute_list+="<option value='"+attributes[temp]+"'>"+attributes[temp]+"</option>";
if(temp==0)
alert(attributes[temp]);
}
attribute_list+="</select>";
alert(attribute_list);
警报(attributes.length);
对于(temp=0;temp为什么不自己检查循环呢
alert(attributes.length);
for(temp=0;temp<attributes.lenth;temp++){
/* test the loop */
console.log(attributes.length);
}
警报(attributes.length);
对于(temp=0;tempattributes.lenth应该是attributes.length,打字错误?控制器呈现javascript,它不执行javascript,所以为什么要进入for循环?JS在客户端浏览器上执行。