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

    评论

报告相同问题?