If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

link to an anchor in document.written document doesn't work

RESOLVED WORKSFORME

Status

()

Core
DOM: Core & HTML
RESOLVED WORKSFORME
16 years ago
16 years ago

People

(Reporter: Martin Honnen, Assigned: jst)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

16 years ago
Mozilla (as NN4) has trouble to correctly link to an anchor in a
document.written document. If I have in frame/window with name windowName some
anchor
  <a name="anchorName">anchor</a>
in a completely document.written document and then a link elsewhere
  <a href="#anchorName" target="windowName">
then Mozilla interprets the link as relative to the url of the document which
created the other one. IE6 is smart enough to figure out that it is a
document.written document and it simply needs to scroll to the anchor in the
document.
I will attach a test case with a frameset which document.writes the content of
two frames, the upper one with anchors, the lower one with links to those anchors.
While in IE6 clicking a link nicely scrolls the upper frame to the anchor linked
to Mozilla on clicking a link loads the frameset into the upper frame. After
that links stop working (probably because there are now two frames with the same
name).
(Reporter)

Comment 1

16 years ago
Created attachment 62670 [details]
test case (click one of the links in bottom frame)
(Reporter)

Comment 2

16 years ago
Created attachment 62671 [details]
JavaScript workaround for the bug

I attach a workaround which allows working around the bug with some JavaScript
that scrolls the frame window instead of letting the browser execute the link.

Comment 3

16 years ago
please check with newest build, since it's working for me...
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.