我正在关注使用画布和JavaScript在HTML中创建简单游戏的在线教程。我试图加载什么似乎是完全正常的代码,但没有什么是显示在屏幕上了,我收到在控制台说未捕获的SyntaxError:意外的令牌=在Chrome中
未捕获的SyntaxError错误:意外的记号=
这是我的代码的部分,其似乎是不正确的:
player = {
x: null,
y: null,
width: 20,
height: 100,
update = function() {},
draw = function() {
ctx.fillRect(this.x, this.y, this.width, this.height)
};
};
PS - 此错误显示在Chrome中。
你应该向我们展示前一行 - 下一行 – axelduch 2015-04-01 08:34:27
我不知道你的exac t代码,但我谷歌,发现这个http://stackoverflow.com/questions/19699257/uncaught-syntaxerror-unexpected-token-in-google-chrome – 2015-04-01 08:37:17
我刚刚阅读该页面,但我仍然不知道该怎么办! – 2015-04-01 08:40:22