javascript - 未捕获的语法错误 : Unexpected token = (Chrome)

标签 javascript jquery

我一直在 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/

相关文章:

javascript - 使用 css 或 js 以一定倾斜 Angular 或椭圆形状旋转对象 360 度

javascript - 使用 jQuery 加载页面时的配色方案?

javascript - 将 +1 附加到电话号码字段值

javascript - 不会改变整个站点高度的可滚动子内容

javascript - 在 $.click 事件处理程序中重新定义它

javascript - dev key 在 fs.Stat 和 nodejs 返回的对象中代表什么

jquery - 更多与 onRegionLabelShow 一起使用的选项 : function with jVectormap

php - 加密 jquery .load() 函数

javascript - todolist双击添加类?

jquery - 使用 event.target 获取类值?