weixin_33736832 2017-07-08 15:46 采纳率: 0%
浏览 99

javascript警报TypeError

In the following javascript code,

        needSubIdCheck = $("#needSubIdCheck").text();
        liveSupplierCount = $("#liveSupplierCount").text();
        subIdCount = $("#subIdCount").text();

         if(needSubIdCheck == 'true')
         {
          if( liveSupplierCount > subIdCount  )
          {
              alert("subIDS Needs to be assigned");
            return false;
          }
        }

The above code gives, "Uncaught TypeError: alert is not a function" in the console. If I change the alert with window.confirm or console.log everything is fine. Can anyone help me to come out of this problem?

  • 写回答

1条回答 默认 最新

  • weixin_33682719 2017-07-08 15:50
    关注

    Nothing is wrong in the given code. Can you check if you are using any pop-up-blockers, this could happen some times. Also check if you have override the alert (var alert = ...,window.alert) some were in the code. This could happen if you are using some external js files as well. For the time being comment out external js files and check if alert is working

    评论

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记