470,614 Members | 1,458 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,614 developers. It's quick & easy.

IE behaviour vs. window.open

In a HTML page, I have this javascript function:

function PopWindow(WinName, WindowUrl) {
if (document.ShowDocs.show[0].checked)
popup = window.open(WindowUrl, "MyWindow")
else
popup = window.open(WindowUrl, 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("win1","path/to/doc1")>document 1</a>
<a href=javascript:PopWindow("win2","path/to/doc2")>document 2</a>
<a href=javascript:PopWindow("win3","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...
Jul 23 '05 #1
2 1246
> popup = window.open(WindowUrl, "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
Jul 23 '05 #2
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" <no****@please.com> wrote in message news:<c6**********@news1.wdf.sap-ag.de>...
popup = window.open(WindowUrl, "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

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Severus Snape | last post: by
14 posts views Thread by D. Alvarado | last post: by
1 post views Thread by Strange Cat | last post: by
11 posts views Thread by Alex.Svetos | last post: by
13 posts views Thread by Tim Marshall | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.