uncaught syntaxerror: unexpected token

今天写飞机大战游戏的js代码时出现uncaught syntaxerror: unexpected token(未捕获的语法错误 意想不到非法令牌错误),百度一下并没有解决我的问题......

这篇博客可以参考一下,http://blog.csdn.net/testcs_dn/article/details/38613893

源码是这样:

经过反复排除测试,发现cssText里面内容不能使用Enter换行,修改后可以运行了。

代码修改如下:

在chrome下调试运行:

运行正确......

界面:

原文地址:https://www.cnblogs.com/jikaiyang/p/5540216.html