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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 16:37:22
Original
1840 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
Latest Issues
alert is not implemented yet
From 1970-01-01 08:00:00
0
0
0
javascript - Add alert to bootstrap popup layer
From 1970-01-01 08:00:00
0
0
0
alert("Hello JavaScript");
From 1970-01-01 08:00:00
0
0
0
Using $t in alert() for Vue’s i18n translation
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template