无效的分配左侧,javascript
作者:互联网
我相信我在做一些愚蠢的事情:
var addhtml = '<div id="leftbio" class="left-float">'
+= '<div id="bioname">e["screen_name]</div>'
+= '<div id="biophoto"><img src="e["profile_image_url"]"/></div>'
+= '<div id="biodetails">e["description"]</div>'
+= '</div>'; // invalid assignment left-hand side
console.log(addhtml);
而Netbeans告诉我无效的分配左侧错误.
怎么了 ?
解决方法:
您不需要=连接,您只需要
还行吧
var addhtml = '<div id="leftbio" class="left-float">'
+ '<div id="bioname">e["screen_name]</div>'
+ '<div id="biophoto"><img src="e["profile_image_url"]"/></div>'
+'<div id="biodetails">e["description"]</div>'
+ '</div>';
console.log(addhtml);
标签:javascript,variable-assignment 来源: https://codeday.me/bug/20191009/1876365.html