Site Navigation

Showing posts with label Anchors. Show all posts
Showing posts with label Anchors. Show all posts

Thursday, October 29, 2009

bug 361 - Anchors collection in IE contains invalid members

Issue: #361
Affects: IE6, IE7, IE8

In the days before the DOM Methods we have today we only had access to a few special collections for things like forms, anchors, links, images, etc.

They may not be as sexy as document.getElementById(), but they worked, and still do to this day... and depending what you are trying to access may actually be much quicker and easier.

So to the point, the document.anchors collection contains an array of all the anchors defined in the page.

Anchors by definition are <a> tags with a name attribute specified.

Now for the bug.

As disclosed in (bug 152) IE has notoriously had issues with differentiating between id and name attributes, polluting IDs with NAMEs and vica versa.

Thus, if you have hyperlinks with an id attribute set in IE... you will now have a new member in the document.anchors collection even though there is no name attribute specified! Have lots of links with id attributes set? Then you have lots of extra items in your document.anchors collection.

Of course the interesting twist on this is that in modern browsers, any element (div, table, span, img) with an id attribute set can act "like" an anchor in that you can add it as a hash tag in the URL to auto-scroll to a specific spot however keep in mind that by definition only an <a> tag with a name attribute set is a valid element in the document.anchors collection.


Known Workarounds: None.



Related Issues: None.


Bug/Site Feedback |
Submit a bug

Thursday, April 10, 2008

bug 371 - named anchor links are broken in IE8

Issue: #371
Affects: IE8 Beta 1, IE8 Beta 2
Fixed In: IE8 PR 1


MSIE Feedback ID: 331609

A regression bug has been found in IE8 Beta 1 whereby an anchor link will not work if the anchor doesn't contain a text node.

Example:

<a name="broken"/>

<a name="works">This works</a>



Known Workarounds: None.



Related Issues: None.

Bug/Site Feedback |
Submit a bug

Thursday, December 13, 2007

bug 312 - Anchor links klobber the page Title in IE

Issue: #312
Affects: IE7, IE8 Beta 1, IE8 Beta 2, IE8 PR1, IE8 RC1

We're not sure when this happened, but in IE7, if you type in a URL in the address bar that links to an anchor within a page (any element with a name or an id), it overwrites the titlebar erasing your designed name, with the URI to your page with the #anchorName appended.

Example:
Try it out, scroll to here!
Now, press Enter in the Address Bar, as if you just typed it.
Now look at the title bar.


Known Workarounds: None.


Related Issues: None.