Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > netscape link problem

Reply
Thread Tools

netscape link problem

 
 
Marco
Guest
Posts: n/a
 
      07-18-2003
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



 
Reply With Quote
 
 
 
 
Grant Wagner
Guest
Posts: n/a
 
      07-18-2003
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 <(E-Mail Removed)>

* 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


 
Reply With Quote
 
 
 
 
Marco
Guest
Posts: n/a
 
      07-18-2003

"Grant Wagner" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
Marco
Guest
Posts: n/a
 
      07-18-2003

"Grant Wagner" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
Grant Wagner
Guest
Posts: n/a
 
      07-18-2003
Marco wrote:

> "Grant Wagner" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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 <(E-Mail Removed)>

* 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Netscape 7.1 to Netscape 8 Skid Schermerhorn Firefox 2 09-05-2005 04:04 PM
RE: Link Link Link =?Utf-8?B?REw=?= Windows 64bit 0 05-17-2005 12:15 PM
Re: Link Link Link DANGER WILL ROBINSON!!! Kevin Spencer ASP .Net 0 05-17-2005 10:41 AM
Netscape with JRE 1.5 beta 1 ignores Netscape signing Mickey Segal Java 1 05-21-2004 01:52 PM
websphere, oracle, netscape: netscape timeout Tom Java 0 08-01-2003 11:03 PM



Advertisments