Home  >  Article  >  Web Front-end  >  How to disable the JavaScript Alert pop-up box and disable the pop-up warning box_javascript tips

How to disable the JavaScript Alert pop-up box and disable the pop-up warning box_javascript tips

WBOY
WBOYOriginal
2016-05-16 16:37:221758browse

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;});

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn