总结一下Invalid left-hand side in assignment的报错问题.即左边的参数引用报错.如下图所示
根据字面意思定位错误代码如下:
复制代码
1
2
3
4
5
6
7
8
9var textMaxlent = document.getElementById("textarea").value.length; if(textMaxlent < maxLenght && anchorNum = 1){ anchorNum ++; if (textMaxlent >= maxLenght ) { anchorNum = 0; } ... }
anchorNum = 1
的写法不正确.应该写为anchorNum == 1
.更改后不报错.程序运行正常,这种在判断操作符中就应该写判断语句,不能写成赋值语句;
最后
以上就是清新往事最近收集整理的关于【程序人生】解决Invalid left-hand side in assignment页面报错问题的全部内容,更多相关【程序人生】解决Invalid内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复