Opening new window in Mozilla

Discussion in 'Javascript' started by Rob, Sep 9, 2003.

  1. Rob

    Rob Guest

    Why does the following code NOT work in Mozilla, but it DOES in IE
    (for Mac) and Safari?

    <a href="somepage.html" onClick="window.open('somepage.html',
    'SomeWindowTitle', 'width=790,height=560, scrollbar=auto,
    menubar=no');">Enter</a>

    Please help...thanks
    Rob, Sep 9, 2003
    #1
    1. Advertising

  2. "Rob" <> schreef in bericht
    news:...
    > Why does the following code NOT work in Mozilla, but it DOES in IE
    > (for Mac) and Safari?
    >
    > <a href="somepage.html" onClick="window.open('somepage.html',
    > 'SomeWindowTitle', 'width=790,height=560, scrollbar=auto,
    > menubar=no');">Enter</a>
    >
    > Please help...thanks


    Works in my copy (Mozilla v1.4), but is the following not what you really
    want?

    <a href="somepage.html" target="SomeWindowTitle"
    onClick="window.open('','SomeWindowTitle',
    'width=790,height=560,scrollbar=auto,menubar=no');">Enter</a>

    P.S.: Watch for spaces in the window properties, they shouldn't be present.


    JW
    Janwillem Borleffs, Sep 9, 2003
    #2
    1. Advertising

  3. Rob

    DU Guest

    Rob wrote:

    > Why does the following code NOT work in Mozilla, but it DOES in IE
    > (for Mac) and Safari?
    >
    > <a href="somepage.html" onClick="window.open('somepage.html',
    > 'SomeWindowTitle', 'width=790,height=560, scrollbar=auto,
    > menubar=no');">Enter</a>
    >
    > Please help...thanks


    As coded, your link will not open a requested popup if javascript is
    disabled. As coded, your link will create a popup and then load the
    referenced resource in the opener too. As coded, the popup will exceed
    the available space for application in MSIE, Mozilla and Opera browsers
    so error compensation/correcting functions will need to spend time, cpu
    to render the window within the os-workarea for applications.

    <a href="somepage.html" target="SomeWindowTitle"
    onclick="window.open(this.href, this.target,
    'width=600,height=500,scrollbars=yes,resizable=yes,status=yes'); return
    false;">Enter</a>

    will open a popup window in all browsers under normal conditions. Note
    that scrollbar=auto will not be honored in MSIE 5+, Mozilla, NS 6+ and
    Opera 7. It must be scrollbars=yes. And you must make sure there is no
    blank space in the 3rd argument string list.

    DU
    --
    Javascript and Browser bugs:
    http://www10.brinkster.com/doctorunclear/
    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
    DU, Sep 10, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick Olurotimi Ige

    Closing child window when opening a new Window

    Patrick Olurotimi Ige, Dec 14, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    444
    Patrick Olurotimi Ige
    Dec 14, 2004
  2. POL8985
    Replies:
    1
    Views:
    551
    Kevin Spencer
    Jan 31, 2005
  3. UJ
    Replies:
    2
    Views:
    7,509
    John Timney \(ASP.NET MVP\)
    Jun 27, 2005
  4. Clara
    Replies:
    6
    Views:
    586
    Clara
    Apr 25, 2005
  5. Allan
    Replies:
    1
    Views:
    109
    Randy Webb
    Aug 6, 2004
Loading...

Share This Page