Home > Web Front-end > JS Tutorial > 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
Release: 2016-05-16 16:37:22
Original
1792 people have browsed it

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>
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template