Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Apr 2004
    Posts
    682
    Thanks
    24
    Thanked 1 Time in 1 Post

    Opening new windows

    I want to open a link in a new window but I want to size the window & take away scrollbars etc etc .. is there a way to do this without it getting blocked by popup stoppers?

    I have working code for this now but I'm thinking it will get blocked by popup stoppers.... all I need is a custom sized window to open when a user clicks a link without it getting blocked by popup stoppers.

    Any help?

    Thanks!

  • #2
    New Coder
    Join Date
    Mar 2004
    Location
    UK
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm afraid the whole idea behind pop-up blockers is to block pop-ups. As what you are wanting to do is to open a pop-up, I'm afraid you're going to find life difficult (for difficult, read "impossible"). After the code to open your pop-up you could put in something like;

    if(!pop-upwindowname){alert("Your PC does not appear to be allowing a pop-up window to open, possibly because you are using software to block unwanted pop-ups. This page will display, but unless you disable your pop-up blocker software temporarily, you may lose functionailty, or be unable to access features on this page.\n\nThe software might be bypassed by pressing and holding the 'Ctrl' key whilst clicking on hyperlinks or buttons that open new windows.")}
    BRUCE

  • #3
    Regular Coder
    Join Date
    Apr 2004
    Posts
    682
    Thanks
    24
    Thanked 1 Time in 1 Post
    Hmmmm..... well I just downloaded & installed one of the most popular popup blockers to see if it blocked the current way I am doing it & it didn't block it heh

    The code I am using in the <head> </head> tags is..

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=225,left = 200,top = 64');");
    }
    // End -->
    </script>
    Then in the link:

    Code:
    <a href="javascript:popUp('select.html')" >

  • #4
    New Coder
    Join Date
    Mar 2004
    Location
    UK
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's because pop-up blockers aren't perfect. You'll find that most block some of the pop-ups some of the time, while a very few block most pop-ups most of the time, however none block all of the pop-ups all of the time. If the one you're using doesn't block your particular pop-up, don't bank on every visitor to your website using the same program.
    BRUCE

  • #5
    Regular Coder
    Join Date
    Apr 2004
    Posts
    682
    Thanks
    24
    Thanked 1 Time in 1 Post
    Good Advice!

  • #6
    New Coder
    Join Date
    Dec 2003
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    with my PUB, when i click a link twice it will pop-up the second time.
    try making a link that makes the same window apear twice
    ...though that may be innoying for people withput PUBs

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    Quote Originally Posted by cyphix
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=225,left = 200,top = 64');");
    }
    [/code]
    The eval statement is not necessary. Search this forum for eval and you'll find that it is evil
    If you want a dynamic global variable, you can use this technique:

    window["page" + id] = window.open(URL, id, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=225,left=200,t op=64');


  •  

    Posting Permissions

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