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 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Open a new window???????

    I need to know how to open a popup window using ASP, I want this to open when the page loads,

    Thanks,

    James

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    You can only open a new window onload using client-side javascript. ASP has nothing to do with it. ASP doesn't know anything about windows/frames/iframes. That's the job of client-side not server-side.

    Code:
    <script type="text/javascript">
    window.onload = function(){
      var w = window.open("http://www.google.com", "_google", "width=800, height=600, resizable=1");
      w.focus();
    }
    </script>
    BTW, that will be blocked by popup blockers.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    You could also use asp to write out the javascript code... that way you still have some amount of control via your asp code.
    For example:
    Code:
    response.write "<script type='text/javascript'>"
    response.wirte "window.onload = function(){"
    ....
    response.write "</script>"
    And so on.. and so forth....
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished

  • #4
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can i make this so it is not blocked by popup blockers

  • #5
    Regular Coder
    Join Date
    Sep 2004
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've seen some weird things from new windows created/controlled by Javascript. I have yet to determine what doesn't get blocked by pop-up blockers and what does. I have the google toolbar installed which has it's own pop-up blocker and sometimes when I click on javascript links that open new windows it works and sometimes it doesn't. If I come across one that works (b/c I can't remember one of the top of my head), I'll post the link here for you to check out. Of course, not all pop-up blockers are the same (kind of like browsers )

  • #6
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Quote Originally Posted by jamesbyrne
    can i make this so it is not blocked by popup blockers
    The easiest way is to not make it auto initiated. It won't be blocked if it is the result of the user clicking on a button or link usually.
    OracleGuy

  • #7
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I think.. at least from what I've seen from workin on code and using popups. Persistent pop-ups tend to eventually NOT get blocked.. But i'm still yet to find that out myself... I see it alot with sites that have persistent, annoying popups. Usually google will block the first one or two but after that... they pop away...!!!
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished

  • #8
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by oracleguy
    The easiest way is to not make it auto initiated. It won't be blocked if it is the result of the user clicking on a button or link usually.
    In my experience... Google blocks windows that are opened after a link is clicked when the onClick triggers a javascript which later opens the window.
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished


  •  

    Posting Permissions

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