Anchor link in new window loads parent

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RobG

    Anchor link in new window loads parent


    I create a new page and write to it. There is an anchor in the
    new page so that users can easily navigate to the bottom. In
    IE, it works fine. In Firefox, it loads the parent page into the
    new page.

    Any ideas?

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    Transitional//EN">
    <html><head><ti tle> Z </title>
    <script type="text/javascript">
    function wrt(a,b) {
    zWin = window.open('', 'result','width =550,height=200 ,menubar=0'
    + ',toolbar=1,sta tus=0,scrollbar s=1,resizable=1 ');
    zWin.document.w riteln('<html>< head><title>Rep ort</title>'
    + '</head><body onLoad=\"self.f ocus()\" style=\"backgro und-color
    eee;\">'
    + '<h1>New Page</h1>'
    + '<table border=\"0\" width=\"100\%\" >'
    + '<tr><td><h2>' + a + '</h2></td>'
    + '<td><a href=\"\#aLink\ ">Link</a>&nbsp;|&nbsp; '
    + '<a href=\"javascri pt:window.close ();\">Close</a></td>'
    + '</tr></table><br><br>< br><br>'
    + b
    + '<br><br><br><b r><br>'
    + '<a name=\"aLink">Y ou\'ve arrived at the link...</a>'
    + '<br>And are still in the New Page'
    + '<br><br><br><b r><br><br><br> '
    + '</body></html>'
    );
    zWin.document.c lose();
    }
    </script>
    </head><body>
    <h1>This is the Start Page</h1>
    <form name="F1"><inpu t type="button" name="B1"
    value="click to display window"
    onclick="wrt(th is.form.name,'t he content');">
    </form>
    </body></html


    -
    Rob

  • Michael Winter

    #2
    Re: Anchor link in new window loads parent

    On Fri, 10 Sep 2004 01:33:41 -0500, RobG
    <RobG.1ccym0@ma il.forum4design ers.com> wrote:
    [color=blue]
    > I create a new page and write to it. There is an anchor in the new page
    > so that users can easily navigate to the bottom. In IE, it works fine.
    > In Firefox, it loads the parent page into the new page.
    >
    > Any ideas?[/color]

    [snip]
    [color=blue]
    > zWin = window.open('', 'result','width =550,height=200 ,menubar=0'
    > + ',toolbar=1,sta tus=0,scrollbar s=1,resizable=1 ');[/color]

    It's probably because there is no URL for the window, so Firefox takes the
    parent window's base URL for this one, too. That's only a guess, though.

    By the way, you could shorten the feature string to:

    'width=550,heig ht=200,toolbar, scrollbars,resi zable'

    [snip]

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.

    Comment

    Working...