在JS代码运行中出现“Uncaught SyntaxError: Invalid or unexpected token at....”错误处理

“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);

 

转载于:https://www.cnblogs.com/yingleiming/p/7654674.html

你可能感兴趣的:(Java,Web)