我收到的错误为
Uncaught SyntaxError: Unexpected token ILLEGAL
在浏览器控制台
<button type="button" class="post-review" onclick="postReview(360_MAH_GE)">Post</button>
<script>(function() {with (this[2]) {with (this[1]) {with (this[0]) {return function(event) {postReview(360_MAH_GE)
};}}}})</script>
最佳答案
问题出在 360_MAH_GE
上。在控制台中尝试一个简单的 var 360_MAH_GE;
以查看相同的错误。
1) 如果它应该是一个变量,则不能在变量名称中使用数字。
2) 如果它应该是某个值,您可以通过将其括在 '360_MAH_GE'
或 "360_MAH_GE"
等引号中,将其变成字符串。
关于javascript - 未捕获的语法错误: Unexpected token ILLEGAL的解决方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29830791/