How to get window.open to open a new window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RobertTheProgrammer
    New Member
    • Aug 2007
    • 58

    How to get window.open to open a new window

    Hi all,

    I'm a bit of a novice with javascript, so be patient with me...

    I'm using the "window.ope n" function to open a new window from my page. I actually have several buttons on my page that each opens the same page with the "window.ope n" function, but each time it uses a different parameter. (i.e. window.open('Ne wWindow.html?pa rams=1') versus window.open('Ne wWindow.html?pa rams=2').

    My problem is that if I open the window with the first button, it works as expected. But when I do the second button (without having first dismissed the first window) it opens the second window in the first window. I would rather have it open a *new* window.

    Is this possible?

    Robert
  • rnd me
    Recognized Expert Contributor
    • Jun 2007
    • 427

    #2
    seems browsers don't like multiple pop-ups per site...

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      It must be the browser settings. If the user chooses, you can't really control how windows are opened. They may choose to open them in tabs or in the same window. Browsers a lot more control over popup windows now.

      You could try using a different name parameter to window.open().

      Comment

      • tburger
        New Member
        • Jul 2007
        • 58

        #4
        Yes, the second parameter in the window.open() method should be an independent window name. This usually forces the creation of an entirely new window, rather than replacing the existing window.

        In response to the above suggestion, what setting might affect this behavior?

        Tom

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Using Firefox extensions, you can control how windows are opened. about:config also gives some options. That's in Firefox, other browsers may also give some form of control.

          Comment

          Working...