Welcome to WebmasterWorld Guest from 126.96.36.199
Forum Moderators: ergophobe
I posted that original topic in 2007 March. It didn't get much play at that time. I'm hoping to spark a little more conversation this time around about the use of Fragment Identifiers.
There's a recent topic that caused me to bring this up. onedodd wants to know how they can take a user to a specific section of a page on another domain within a <iframe>.
Scrolling to bottom of page.
What a perfect opportunity to bring up Fragment Identifiers. If the third party page they want to reference within their <iframe> utilizes Fragment Identifiers, they can easily do this and put the user right at the area they need to be...
Now, if that third party page does not have a specific fragment to identify that section, I can search around to see if there is anything close by that has an ID I can reference to put the user as close as possible to that chart. While not the best solution, it does get them closer to the target. The ultimate scenario would be something like this...
<h2 id="SeaWater">Sea Water Chart</h2>
If that is what resided on that third party page, I could now take my <iframe> src URI and do this...
Putting my visitor right at the Sea Water Chart on the third party domain that is being displayed within that <iframe></iframe> on my site.
All sites that I develop these days have IDs on all <h> elements. Since the pages are structured semantically, I can put a user right at a specific section on any page at any time by using a Fragment Identifier. When I reference "user", I'm referring to "all users". I've found that marketing folks love this feature as they can target specific areas of pages when making changes, explaining things to their clients, etc.
Ever get an email and need to send someone to a page on a website somewhere? And that page was fairly dense with content? Wouldn't it be nice to just send them a link to the area they might be interested in? Maybe its an FAQs page and you need to send them to FAQ #11. My FAQs page might utilize the <dl> element so I'm going to have IDs assigned to each of the <dt>s within. :)
Are you using them? How have they benefited you? What have you called them? I know the term "Fragment Identifiers" might be a bit alien to some. Years ago I may have called them "Named Anchors" but the name attribute has been deprecated in favor of IDs.
To prevent such a waste of time for my sites' visitors, I have used fragment identifiers to quickly land them at specific information on a page. I use them mainly in email marketing, on FAQ pages, and to break up pages that are dense in content. Now that you mention it, I'm sure they also make it easier for third parties to link to specific information on my sites as well.
I have called fragment identifiers "anchor" links until I was recently corrected to the proper lingo. My intranet software's HTML editor also refers to them as anchors. :)
It can be overdone, however - fragment identifiers are not a replacement for non-semantic elements, and it is always important to consider splitting the content over several pages rather than depending on fragment identifiers to navigate an overly-large document.
i think they are often called anchors because a "named anchor tag" can be used as a fragment identifier.
Ah-ha, but the Name Attribute has been deprecated on certain elements in XHTML like the a element, hence the use of the term Fragment Identifiers and the use of ID vs NAME. ;)
I've heard them referred to as; Named Anchors and Bookmarks. FrontPage used to call them Bookmarks in the WYSIWYG menus and assign the "a" attribute when used. I know, that term Fragment Identifier throws quite a few off as they've not heard that used in this instance. That is the official terminology for this particular topic. Kind of like how URI has replaced URL but most still use URL. ;)
Welcome to WebmasterWorld MichelleStute!
This attribute is used to define a named anchor for use as the destination of hypertext links. For example, the following defines an anchor than can be used as the destination of a jump into a description of the Boston area.
The <A NAME="potomac">Potomac river</A> flows into Boston harbour.
Note: the NAME attribute has been superceded by the ID attribute. User agents should include support for NAME to ensure backwards compatibility with legacy documents produced using previous versions of HTML.
Source: HTML 3 Specs
So, although it was superceded back in HTML3, the use of the phrase continued as it carried over into HTML 4.01 a tad (search for "named anchor" on this page):
... and note "fragment identifier" use there as well!
Ah-ha, but the Name Attribute has been deprecated on certain elements in XHTML like the a element, hence the use of the term Fragment Identifiers and the use of ID vs NAME.
Ah yes, deprecated, but not removed. Why? Because certain user agents didn't get it right and the W3 knew this when they delivered the standard:
Many existing HTML clients don't support the use of ID-type attributes in this way, so identical values may be supplied for both of these attributes to ensure maximum forward and backward compatibility (e.g., <a id="foo" name="foo">...</a>).
I recall assisting others with issues in regards to using the id attribute as opposed to the name attribute (or both as mentioned in the standard), but said assistance may have been some time ago now. Can anybody recall the last browser version of the majors that did NOT support id as a fragment identifier correctly?
but the Name Attribute has been deprecated on certain elements in XHTML like the a element
I well remember when id had almost no support. Truth be told, until quite recently I have stayed with <a name=""> It may be deprecated, but still validates with W3C, so I've been pretty lax in changing my ways - and I use 'name' (now id) anchors pretty extensively. A big plus to point to an exact point on a page, even if it's not that large. You used to have to surround the <a> with a <p> or <div>. Looks like that has gone away as well. Used to always get something like '<a> not allowed here. Must be enclosed by...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
Welcome to WebmasterWorld MichelleStute:))