W3C home > Mailing lists > Public > www-html@w3.org > December 2001

RE: anchors

From: Hoyt, Phil <Phil.Hoyt@globeinteractive.com>
Date: Sun, 2 Dec 2001 18:20:41 -0500
Message-ID: <F61568F110EAD411BD350008C7860164091FE2B2@commercial.globeinteractive.com>
To: "'www-html@w3.org'" <www-html@w3.org>
That helps, but I think it's very clumsy. It breaks one of my unwritten
rules of good html: never use javascript to do something fundamental to the
use of the site. Also, writing the entire URL out just doesn't work in a
servlet-generated site where the URL could be just about anything. In short,
this problem is entirely preventing me from using base href.

I would like to be able to refer to an anchor in the document in question,
or one at the base href alternately depending on the syntax I use. Something
like "/#anchor" refers to the base href, while "#anchor" refers to the
current document. Or, perhaps more reverse-compatible, one could use 
"./#anchor"

-----Original Message-----
From: Vix [mailto:vixcc@yahoo.com] 
Sent: Sunday, December 02, 2001 6:13 PM
To: Hoyt, Phil; www-html@w3.org
Subject: Re: anchors

Phil,

I think that the Spec is clear about that.
A BASE href is meant to be the basis for all HREFs without a BASE explicitly
declared in their
HREF section.

Thus, having the tag <a href="#top">, with a BASE
HREF="http://www.url.com/", this means that the
anchor must be appended to the BASE in this case. This ends up as:
http://www.url.com/#top

So far was only meant to discuss the SPEC part.
Going back to being able to specify #anchors inside your document, there are
TWO ways that I know
of, even if you're using BASE hrefs.

1- Have the URL explicitly declared with the anchor. <a
href="http://thisfile.com/#top">link
here</a?

2- Use a javascript function to fill in the Document.location at run-time if
you don't know the
file name or if you are afraid that the file name might be changed without
the HREF updated as
well.

I hope the above helps.

Best regards,

Vix!



=====
_,.<~=`^`=~>.,_,.<~=`^`=~>.,_,.<~=`^`=~>.,
------> tAke a bReak! gEt eNtertained!
------> http://www.sallini.com/
^`=~>.,_,.<~=`^`=~>.,_,.<~=`^
-> http://netdesignplus.net/
-> It works... It Pays...
_,.<~=`^`=~>.,_,.<~=

__________________________________________________
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com
Received on Sunday, 2 December 2001 18:21:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:50 GMT