小编Tir*_*ako的帖子

JavaScript中未识别var(语法错误)

我一直在努力寻找解决问题的方法.Firebug说语法错误,JSHint说"预期标识符而不是'var'." 在第4行(var test1 = [)你能告诉我为什么会发生这个错误吗?谢谢!

function name() {
    if (
    var test1 = ['selected': -1, 'AF': 0.02];
    var selectedTest1 = $('#test1').val();
    var rate = rates(selectedTest1);
    var callMinutes = document.calc.minutes.val();
    document.calc.pay.value = selectedTest1 * callMinutes;)
    else(
    (document.calc.test1.value == null) || (document.calc.minutes.value == null || document.calc.minutes.value.length == 0)) {
        document.calc.pay.value = "Incomplete data";
    }
};
Run Code Online (Sandbox Code Playgroud)

javascript syntax-error

-3
推荐指数
1
解决办法
660
查看次数

标签 统计

javascript ×1

syntax-error ×1