PDA

View Full Version : Stopping JavaScript alert boxes



thinksmart12
10-14-2006, 03:15 AM
Hello,
I have a script on my web page that shows an alert box every time it loads. Is there a possible way to disable this alert box so that it does not show on the page load. I know you could just remove the tags, but is there any "counter" javascript code that cancels onLoad events or just alert boxes?

Thanks,
John

ak7861
10-14-2006, 04:50 AM
Hello,
I have a script on my web page that shows an alert box every time it loads. Is there a possible way to disable this alert box so that it does not show on the page load. I know you could just remove the tags, but is there any "counter" javascript code that cancels onLoad events or just alert boxes?

Thanks,
John
Why would you have alert boxes on your site in the first place? :rolleyes: Unless youre using a shareware script. ;)

tech_support
10-14-2006, 05:45 AM
Did you post this?
http://www.dynamicdrive.com/forums/showthread.php?p=56234

Anyway...

You can't.

And if it is shareware,

Please do not make illegal requests.

jscheuer1
10-14-2006, 07:58 AM
There is a simple and legal way to stop javascript alerts. Turn off javascript in your browser.

thinksmart12
10-14-2006, 04:35 PM
No, I was actually going to show a friend how to use javascript to neutralize certain effects.

And no, I did not post that other thing.

Twey
10-14-2006, 04:55 PM
window.realAlert = window.alert;
window.alert = function() {};

jscheuer1
10-14-2006, 07:28 PM
windert = windlert;
windert = func) {};

This could be a violation of the forum's terms of use - certainly borders on it. I don't mean to be mean or scary (Halloween is coming up though) - just wanted to do a little reality check here.

mburt
10-14-2006, 07:35 PM
You could disable the window.onload:

window.onload = null

or


window.onload = function() {
}

Twey
10-14-2006, 07:36 PM
This could be a violation of the forum's terms of use - certainly borders on it.The OP said that it's not intended to be used for illegal purposes; therefore, it's not a violation. What the OP actually does with the code I've supplied is his/her problem.

jscheuer1
10-14-2006, 07:46 PM
No, I was actually going to show a friend how to use javascript to neutralize certain effects.

And no, I did not post that other thing.

You really are thinking smart. But, to do that, you would have already needed to know how.

jscheuer1
10-14-2006, 07:48 PM
The OP said that it's not intended to be used for illegal purposes; therefore, it's not a violation. What the OP actually does with the code I've supplied is his/her problem.

Such a trusting soul. ;)