混淆的JSLINT错误

Confusing JSLINT Error

本文关键字:错误 JSLINT      更新时间:2024-01-01

我正在为我和朋友玩的桌面策略游戏制作一个JavaScript掷骰子器,但我遇到了一个障碍。基本上有一个不规则的命中表,所以我不能用公式(据我所知)来判断结果,相反,我有一大堆开关,如果。。else语句,以确定它们是成功还是失败。由于我已经纠正了JsLint显示的所有其他错误,但这些错误我似乎没有任何意义,因为它们引用的字符在单词中间。

这是jsFiddle:

http://jsfiddle.net/UEKh6/10/

Error:
Problem at line 19 character 12: Missing semicolon.
var aContnt["<h1>Broken History - Dice roller tool</h1><p>Choose one of the f...
Problem at line 19 character 1249: Expected an assignment or function call and instead saw an expression.
var aContnt["<h1>Broken History - Dice roller tool</h1><p>Choose one of the f...
Implied global: prompt 64,66,262,264,441, morale 441,443, iRoll 442,443

在数组的开头和变量声明之间需要一个=符号。

var aContnt = ["

http://jsfiddle.net/rlemon/UEKh6/14/请参阅添加了=