Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

pop-up blocker jafa code??

mmaassaammaassaa Posts: 1Member
I would like to add pop-up blocker to a few of my
web pages. I remember seeing a routine several years ago
where it redefined a newpage or window type function.
Can anyone help me prevent popups?

Comments

  • WeirdofreakWeirdofreak Posts: 439Member
    Well, considering that the easiest thing to do would be not to use popups, I'd guess you have no control over them. Which in turn leads me to believe you're not supposed to get rid of them.

    ...so this didn't come from me, right?

    Anyway, I believe that all you have to do is redefine the function. Since open is a method of window anyway, all you have to do is:

    function open() {
    return false; //to allow for probable weirdness
    }

    It'll only work if it's defined before it gets called, so put it as high as you can.
Sign In or Register to comment.