netscape link problem

Discussion in 'Javascript' started by Marco, Jul 18, 2003.

  1. Marco

    Marco Guest

    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
     
    Marco, Jul 18, 2003
    #1
    1. Advertising

  2. Marco

    Grant Wagner Guest

    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 <>

    * 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
     
    Grant Wagner, Jul 18, 2003
    #2
    1. Advertising

  3. Marco

    Marco Guest

    "Grant Wagner" <> wrote in message
    news:...
    > 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
     
    Marco, Jul 18, 2003
    #3
  4. Marco

    Marco Guest

    "Grant Wagner" <> wrote in message
    news:...
    > 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
     
    Marco, Jul 18, 2003
    #4
  5. Marco

    Grant Wagner Guest

    Marco wrote:

    > "Grant Wagner" <> wrote in message
    > news:...
    > > 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 <>

    * 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
     
    Grant Wagner, Jul 18, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    904
    Kevin Spencer
    May 17, 2005
  2. Tom
    Replies:
    0
    Views:
    507
  3. Mickey Segal
    Replies:
    1
    Views:
    681
    Mickey Segal
    May 21, 2004
  4. Shan
    Replies:
    3
    Views:
    443
    Spartanicus
    Jan 15, 2004
  5. yaktipper
    Replies:
    10
    Views:
    297
    Richard Cornford
    Jul 10, 2003
Loading...

Share This Page