Click here to get back home

Empty fragment

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Empty fragment Harlan Messinger 07-07-2005
---> Re: Empty fragment David Håsäther07-07-2005
| ---> Re: Empty fragment Harlan Messinge...07-07-2005
|   `--> Re: Empty fragment Jukka K. Korpel...07-08-2005
Posted by Harlan Messinger on July 7, 2005, 10:10 am
Please log in for more thread options


Is the following a legal URL?

        http://www.invalid.com/path#

This underlies my real questions:

1. Is <a href="#"> a *valid* (whether or not intentionally) way to go to
the top of a page.

2. Whether or not valid, do the usual browsers actually support this?

I'm asking because I'm reviewing a large set of pages created by several
other people, and many of them are using this device to return to the
top of the page. (No need to reopen the argument about not using Back to
Top links at all--not my decision!)

Posted by David Håsäther on July 7, 2005, 3:04 pm
Please log in for more thread options



> Is the following a legal URL?
>
> http://www.invalid.com/path#

Yes.

> This underlies my real questions:
>
> 1. Is <a href="#"> a *valid* (whether or not intentionally) way to
> go to the top of a page.

AFAIK, the behavior is undefined for empty fragment identifiers. I'm
not sure though, so you may want to look into RFC 2396 (somewhere
around section 4 maybe).

> 2. Whether or not valid, do the usual browsers actually support
> this?

IE, Mozilla and Opera does to my knowledge, and I think this is the
most common behavior for browswers.

--
David Håsäther

Posted by Harlan Messinger on July 7, 2005, 1:09 pm
Please log in for more thread options


David Håsäther wrote:
>
>>Is the following a legal URL?
>>
>> http://www.invalid.com/path#

I guess that should be either www.example.com or www.something.invalid.

>
> Yes.
>
>>This underlies my real questions:
>>
>>1. Is <a href="#"> a *valid* (whether or not intentionally) way to
>>go to the top of a page.
>
> AFAIK, the behavior is undefined for empty fragment identifiers. I'm
> not sure though, so you may want to look into RFC 2396 (somewhere
> around section 4 maybe).

Yeah, it still doesn't seem to answer the question.

>>2. Whether or not valid, do the usual browsers actually support
>>this?
>
> IE, Mozilla and Opera does to my knowledge, and I think this is the
> most common behavior for browswers.

I just checked: even Lynx does.

Posted by Jukka K. Korpela on July 8, 2005, 7:04 pm
Please log in for more thread options



>>>1. Is <a href="#"> a *valid* (whether or not intentionally) way to
>>>go to the top of a page.
>>
>> AFAIK, the behavior is undefined for empty fragment identifiers.
>> I'm not sure though, so you may want to look into RFC 2396
>> (somewhere around section 4 maybe).
>
> Yeah, it still doesn't seem to answer the question.

RFC 2396 has been superseded by RFC 3986 (STD 66) in January 2005.

I haven't studied RFC 3986 in detail, but it seems to have obscured
things somewhat. The one-character string "#" is surely a syntactically
correct URL, but its meaning is not explicitly defined.

P.S. "Valid" is not the right word here; e.g.
<a href="! ¤¤ ##%">foo</a>
is valid but incorrect.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


Posted by John Dunlop on July 12, 2005, 8:07 pm
Please log in for more thread options


Harlan Messinger wrote:

> Is the following a legal URL?
>
>         http://www.invalid.com/path#

doesn't violate STD66 anyway.

> This underlies my real questions:
>
> 1. Is <a href="#"> a *valid* (whether or not intentionally) way to go to
> the top of a page.

valid, and moreover conforms to the text of the spec, read
loosely.

My take on it is, in a text/html doc, an empty fragment
designates an element named with the empty string (so that
element can't be named with 'id'). If that element doesn't
occur, the semantics of the fragment identifier are unknown.

> 2. Whether or not valid, do the usual browsers actually support this?

My Lynx (2.8.3) moves me to the top, no matter if an element's
named "" or not; but my Opera (7.54) does not move me to the
top, although if an element is named "" (even with 'id', which
violates the spec), it moves me there.

--
Jock

Similar ThreadsPosted
Centered fragment in a paragraph June 3, 2008, 3:53 pm
Weird: IE renders fragment of HTML twice January 31, 2006, 5:09 am
Empty Alt Tags April 1, 2005, 3:16 pm
Empty link August 28, 2005, 12:33 pm
What's at the end of empty xhtml tags? February 19, 2006, 2:55 am
empty form actions September 5, 2006, 4:48 pm
W3C Validator and empty body element August 1, 2004, 2:37 am
Migrating to XHTML: empty elements July 9, 2005, 12:55 pm
Tidy trimming empty tags August 29, 2005, 6:30 pm
proper ways for empty link November 18, 2005, 2:53 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap