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

    problem launching two pop ups!

    I am having problems launching two pop up windows. I must be doing something wrong here and I cannot figure it out with all the forum searches and help sites. the script I have works in launching the first pop-up but not the second one. Any suggestions?

    The script is as follows;

    <script LANGUAGE=JavaScript1.1 type="text/javascript">
    function nw() {
    var sw = screen.width;
    var sh = screen.height;
    var wh = 400;
    var ww = 900;
    var wx = (sw-ww)/2;
    var wy = (sh-wh)/2;
    window.open('index2.html','Lunds','height='+wh+',width='+ww+',top='+wy+',left='+wx+',toolbar=no,menu bar=no,status=no,scrollbar=no,resizable=no,minimize=no,maximize=no');
    }
    </script>
    <script>
    function invite() {
    window.open('invite.html','Lunds','height=400,width=400,toolbar=no,menubar=no,status=no,scrollbar=no ,resizable=no,minimize=no,maximize=no');
    }
    </script>


    <body bgcolor="white" onLoad="nw();" onLoad="invite();">

  • #2
    Regular Coder
    Join Date
    Nov 2002
    Location
    Carmel California
    Posts
    471
    Thanks
    0
    Thanked 1 Time in 1 Post
    you cant have two onloads like that, change <body bgcolor="white" onLoad="nw();" onLoad="invite();"> to
    <body bgcolor="white" onLoad="nw(); invite();">
    Kris Hubby
    kwhubby site

  • #3
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    or

    <script>
    ...
    window.onload=function(){nw(); invite()}
    </script>
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Another problem will still prevent this from working. Once of the parameters you pass to the window.open function is the name of the new window. Once a window is named, any more references to that window name will also use that exact same window. Since both of your window.open calls use the same name then the first window is being opened and then when the second window.open call is processed it's trying to open that in the same window. Change the window name in one of those two calls and you'll get two popups.
    Check out the Forum Search. It's the short path to getting great results from this forum.


  •  

    Posting Permissions

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