我一直在 Chrome 的控制台日志上收到此消息:
Uncaught SyntaxError: Unexpected token
它在 Firefox 上运行良好。
我做了一些研究,结果显示 Chrome 不支持命名参数。但我在发现错误的第 131 行没有任何命名参数。
下面是我正在使用的代码。任何帮助将不胜感激!
var id = checkbox_element.attr('id');
var recurring_cycle_dropdown = $("#recurring_cycle");
var label = $("label#" + id);
//Display the radio options pricing method when the payment type checkbox has been checked
if (checkbox_element.is(":checked")) {
/*If the checkbox id is recurring show the recurring cycle right
* after the label next to the radio button, */
if(id == "recurring"){
label.after(recurring_cycle_dropdown.show(0, function(){
//The $(this) is referring to the recurring_cycle_dropdown
//not the checkbox
$(this).css("display","block");
//****THIS IS THE LINE WHERE THE ERROR IS FOUND****
$(this).prop("disabled",false);
}));
}
最佳答案
如果您在代码中使用默认参数,则可能会发生这种情况。 Javascript 不允许这样做,但 Firefox 以某种方式否决了它。
关于javascript - 未捕获的语法错误 : Unexpected token = (Chrome),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29055766/