identifier starts immediately after numeric literal 意思是语法错误

来源:互联网 发布:网络电视怎么看中央8吗 编辑:程序博客网 时间:2024/05/17 17:58

在html遍历对象赋值时,给事件添加了一个对象的id,点击触发时,发生了

identifier starts immediately after numeric literal  这个错误,语法错误,数字后面不能直接跟字符串,不能编译通过。


错误:<a href="#" id="delete" onClick="deleteuser(item.id)>删除</a>
解决:<a href="#" id="delete" onClick="deleteuser('item.id')>删除</a>   在这个item.id上加上''引号,就行了。



原创粉丝点击