Method to disable JavaScript's Alert pop up box to disable the pop up warning box

  • 2020-03-30 03:52:20
  • OfStack

This article will show you how to disable JavaScript's Alert pop-up, which means to disable JavaScript's Alert pop-up.

Because advocate green get online environment now, popup box unavoidably can affect your mood, so through the following code can be blocked Js popup box.

<script LANGUAGE="JavaScript">
window.alert = function(str){
return ;
alert(" The warning box cannot pop up ");//-->

The idea is to override the "alert" method with the syntax: "old method =function(parameter){new method's content}". The return value should be "false" to indicate that nothing is being done. Javascript :alert(window.alert=function(STR){return; });

Related articles: