By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,382 Members | 1,645 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,382 IT Pros & Developers. It's quick & easy.

netscape link problem

P: n/a
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

Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Marco wrote:
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 <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_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-deve...upgrade_2.html
Jul 20 '05 #2

P: n/a

"Grant Wagner" <gw*****@agricoreunited.com> wrote in message
news:3F***************@agricoreunited.com...
Marco wrote:
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>


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
Jul 20 '05 #3

P: n/a

"Grant Wagner" <gw*****@agricoreunited.com> wrote in message
news:3F***************@agricoreunited.com...
Marco wrote:
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>


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
Jul 20 '05 #4

P: n/a
Marco wrote:
"Grant Wagner" <gw*****@agricoreunited.com> wrote in message
news:3F***************@agricoreunited.com...
Marco wrote:
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>


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


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 <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_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-deve...upgrade_2.html
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.