Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Stopping JavaScript alert boxes

  1. #1
    Join Date
    Oct 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Stopping JavaScript alert boxes

    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

  2. #2
    Join Date
    Oct 2006
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by thinksmart12
    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? Unless youre using a shareware script.

  3. #3
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Did you post this?
    http://www.dynamicdrive.com/forums/s...ad.php?p=56234

    Anyway...

    You can't.

    And if it is shareware,

    Please do not make illegal requests.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There is a simple and legal way to stop javascript alerts. Turn off javascript in your browser.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Oct 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    window.realAlert = window.alert;
    window.alert = function() {};
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey
    Code:
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    You could disable the window.onload:
    Code:
    window.onload = null
    or

    Code:
    window.onload = function() {
    }
    - Mike

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by thinksmart12
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •