SyntaxError:identifier starts immediately after numeric literal

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Joyce_heart/article/details/78403096
在js拼接html代码的时候,有时会遇到这样的<button onclick="test(id)"></button>代码
那么中间的方法就需要这样拼接  onclick=\"test(\'"+id+"\')\",如果拼接错误就会报上面的错

猜你喜欢

转载自blog.csdn.net/Joyce_heart/article/details/78403096
今日推荐