Skip to content Skip to sidebar Skip to footer

Block Javascript Alert Box

I'm working on a website using extensively javascript. The code I'm working on also rely on other big javascript libs. The thing is that somewhere in these libraries, some alert bo

Solution 1:

Save the old alert function, to a variable.

_alert=alert;

And then set the old alert to either null a custom function.

alert=function(){};
/*or*/
alert = null;

To restore the original version of alert simply reverse step 1.

alert=_alert

Post a Comment for "Block Javascript Alert Box"