IE behaviour vs. window.open

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yves-Alain NICOLLET

    #1

    IE behaviour vs. window.open

    In a HTML page, I have this javascript function:

    function PopWindow(WinNa me, WindowUrl) {
    if (document.ShowD ocs.show[0].checked)
    popup = window.open(Win dowUrl, "MyWindow")
    else
    popup = window.open(Win dowUrl, WinName)
    }

    and further:

    <form name="ShowDocs" >
    ....
    <input TYPE="radio" NAME="show" value=same checked>
    <br>
    <input TYPE="radio" NAME="show" value=diff>
    ....
    </form>

    and further:

    <a href=javascript :PopWindow("win 1","path/to/doc1")>document 1</a>
    <a href=javascript :PopWindow("win 2","path/to/doc2")>document 2</a>
    <a href=javascript :PopWindow("win 3","path/to/doc3")>document 3</a>

    How is it that it works OK with NS4, NS7, Mozilla, but that IE opens
    each document in a separate window even if the first "show" radio is
    checked?

    I have added an alert(document. ShowDocs.show[0].checked) at the
    beginning of the function and it gives "true".

    Thanks for a clue...
  • Mike

    #2
    Re: IE behaviour vs. window.open

    > popup = window.open(Win dowUrl, "MyWindow")

    By "MyWindow" do you mean the name of the current window? So you are
    expecting that the URL be loaded in the current window and not in a popup?

    If this is true then replace this line of code with:

    window.location .href = WindowURL;

    no need to use the open method.

    Mike


    Comment

    • Yves-Alain NICOLLET

      #3
      Re: IE behaviour vs. window.open

      No, MyWindow is an arbitrary name for a new window. I could have
      called it XYZ or WhatEver. But I really need to use open since I want
      the new document to show up in another window than the one holding the
      original link; if this window is not yet created, then it should be,
      and if already created, it should be reused. But the real question is:
      why all browsers *but IE* understand my script and what should I do
      for IE to understand it too?

      "Mike" <nospam@please. com> wrote in message news:<c6u4vb$kt i$1@news1.wdf.s ap-ag.de>...[color=blue][color=green]
      > > popup = window.open(Win dowUrl, "MyWindow")[/color]
      >
      > By "MyWindow" do you mean the name of the current window? So you are
      > expecting that the URL be loaded in the current window and not in a popup?
      >
      > If this is true then replace this line of code with:
      >
      > window.location .href = WindowURL;
      >
      > no need to use the open method.
      >
      > Mike[/color]

      Comment

      Working...