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 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2006
    Posts
    96
    Thanks
    3
    Thanked 0 Times in 0 Posts

    New window from a new window

    Hi all.

    Ok firstly let me point out that js is all new to me. But I have this script:

    Code:
    function popup(url) {
    mywindow = window.open(url, 'name', 'resizable=0, scrollbars=0, height=600, width=728');
    return false;
    }
    Which creates a new window with this: <a href="#" onclick="popup('advert_popup.php')">Launch popup</a>

    But within this new window I wish to create another new window link with this

    Code:
    function picwindow(url) {
    mywindow2 = window.open(url, 'name', 'resizable=0, scrollbars=0, height=480, width=640');
    return false;
    }
    and the link: <div id="popup_magnify"><a href="#" onclick="picwindow('big_pic.php')"><img src="images/magnifying_glass.png" alt="magnifying glass" /></a></div>

    What happens is that the new page 'big_pic.php' does not open in a new window but replaces the contents of the original window.

    Basically everytime I create a popup window link I want a new window to appear but leaving the old one behind.

    Any ideals?
    Steve

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    coz u have the same name
    Code:
    window.open(url, 'name'...)
    try giving it a different name or make it a parameter to the function

  • #3
    New Coder
    Join Date
    Jul 2006
    Posts
    96
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Many thanks
    Steve


  •  

    Posting Permissions

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