“Uncaught SyntaxError: Invalid or unexpected token at....”,该类错误出现时首先检查代码是否出现错误,若JS代码没有错误,就检查(),{},<,>,;这些符号是否出错了。
function Person(){
}
var dom=Person.prototype;
console.log(dom);
Person.prototype.name="Yingleiming";
Person.prototype.age=28;
Person.prototype.job="Software Engineer";//此处错误的使用了中文符号
Person.prototype.sayName=function(){
alert(this.name);
};
console.log(dom);
本文深入解析JavaScript中常见的“Uncaught SyntaxError”错误,通过具体代码示例,详细讲解如何定位和修复由不正确的符号引发的问题。
3558

被折叠的 条评论
为什么被折叠?



