Forum Moderators: open

Message Too Old, No Replies

Is it possible to disable Javascript Alert boxes using Javascript

Expert Level Question

         

IanTurner

9:13 pm on Feb 13, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



The scenario is thus, I have some javascript which I have been debugging by using alerts.

Is there a way of disabling the alert boxes by putting a javascript command in earlier in the processing or by running an inline function.

RonPK

11:14 am on Feb 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Quick and dirty, but it works (tested in IE6):

function alert() {}

This redefines the alert-method to a function that doesn't do anything.

IanTurner

2:44 pm on Feb 14, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



RonPK you're a marvel - I owe you a drink for that one.

Absolutely beautiful solution.

Many thanks