netscape link problem

M

Marco

I made an html-page with this line in it:

<A HREF="http://www.bla.com" onClick="javascript:window.close()"
target="moeder">link</A>

It works very well in Internet Explorer, but in Netscape 7 the url isn't
opened in the moeder window. How come and how can I fix it so it works in
Netscape too? Thanks in advance for any answers.

Mrco
 
G

Grant Wagner

Marco said:
I made an html-page with this line in it:

<A HREF="http://www.bla.com" onClick="javascript:window.close()"
target="moeder">link</A>

It works very well in Internet Explorer, but in Netscape 7 the url isn't
opened in the moeder window. How come and how can I fix it so it works in
Netscape too? Thanks in advance for any answers.

Mrco

<a href="http://www.bla.com"
target="moeder"
onclick="window.open(this.href, this.target);window.close();return
false;">link</a>

Note that if the window you are trying to close wasn't opened by script,
Netscape will fail with an error in the JavaScript Console of: "Scripts may
not close windows that were not opened by script."

--
| Grant Wagner <[email protected]>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
* http://www.mozilla.org/docs/web-developer/upgrade_2.html
 
M

Marco

Grant Wagner said:
<a href="http://www.bla.com"
target="moeder"
onclick="window.open(this.href, this.target);window.close();return
false;">link</a>

Thanks for the reply, but moeder already exists and this opens a new window.
I want to open the url in the existing moeder window.
Note that if the window you are trying to close wasn't opened by script,
Netscape will fail with an error in the JavaScript Console of: "Scripts may
not close windows that were not opened by script."

Yeah, I know. Unfortunately I am not the one who decides how the window is
opened. Different project. Can't have it all. :)

Regards,

Marco
 
M

Marco

Grant Wagner said:
<a href="http://www.bla.com"
target="moeder"
onclick="window.open(this.href, this.target);window.close();return
false;">link</a>

Thanks for the reply, but moeder already exists and this opens a new window.
I want to open the url in the existing moeder window.
Note that if the window you are trying to close wasn't opened by script,
Netscape will fail with an error in the JavaScript Console of: "Scripts may
not close windows that were not opened by script."

Yeah, I know. Unfortunately I am not the one who decides how the window is
opened. Different project. Can't have it all. :)

Regards,

Marco
 
G

Grant Wagner

Marco said:
Thanks for the reply, but moeder already exists and this opens a new window.
I want to open the url in the existing moeder window.


Yeah, I know. Unfortunately I am not the one who decides how the window is
opened. Different project. Can't have it all. :)

Regards,

Marco

When window.open() is called a second time with the same window name (second
parameter), it loads the content into the same window instance.

Ignoring the window.close() for a second, please try the following code:

<a href="http://www.bla.com"
target="moeder"
onclick="window.open(this.href, this.target);return false;">link 1</a>
<a href="http://www.yahoo.com"
target="moeder"
onclick="window.open(this.href, this.target);return false;">link 2</a>

Tested in IE6SP1, Netscape 4.78, Mozilla 1.5a and Opera 7.11. In all browsers,
no matter how many times I clicked the links in sequence or one after another, I
only ever had one new window opened. This is the way window.open() is supposed
to work.

--
| Grant Wagner <[email protected]>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
* http://www.mozilla.org/docs/web-developer/upgrade_2.html
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,233
Latest member
AlyssaCrai

Latest Threads

Top