Home > Article > Web Front-end > How to disable the JavaScript Alert pop-up box and disable the pop-up warning box_javascript tips
This article will introduce how to disable the JavaScript Alert pop-up box, that is, disable the JS alert box from popping up.
Because a green Internet environment is now advocated, pop-up boxes will inevitably affect your mood, so the Js pop-up boxes can be blocked by using the following code.
<script LANGUAGE="JavaScript"> <!-- window.alert = function(str){ return ; } alert("不能弹出警示框");//--> </script>
The implementation idea is to rewrite the "alert" method. The rewritten syntax is: "old method = function (parameter) {content of new method}". The return value should be "false", which means no operation is performed. You can also enter in the address bar: javascript:alert(window.alert=function(str){return;});