【问题标题】:Unexpected end of input Jquery输入 Jquery 意外结束
【发布时间】:2013-04-02 03:20:08
【问题描述】:

我收到此错误,但我在发布前检查了所有括号 20 次。会不会有别的问题?谢谢!!!

var ifBlock = function (options) {
    var options1 = options['entry']
    var options2 = options['condition']
    if (options1 != null && options2 != null) {
        return eval("VB.interpreter.dictionary["+options1+"]" + " " + options2)
    } else {
        return false
    }
}

【问题讨论】:

  • 您的 eval 中的代码将生成无效的 javascript。 VB.interpreter.dictionary[somevalue] someothervalue 你错过了= 吗?你不需要 eval 。
  • 给出的代码应该可以工作,给options1options2的正确值。

标签: jquery input syntax-error


【解决方案1】:

通过http://jsbeautifier.org/ 运行您的整个代码,并检查您的整个脚本中是否缺少某些括号(您可能是)。

【讨论】:

    猜你喜欢
    • 2015-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-22
    • 2016-08-05
    • 2018-01-23
    • 2020-07-10
    • 2020-09-04
    相关资源
    最近更新 更多