Href to the current page

R

rf

brucie said:
in post: <

RFC2606 is new and improved with only one third the fat so its healthier
for you.

But it does not talk about fragment identifiers, only TLDs.
but.. but.. but.. even if that is so a '#' and the fragment is not part
of a URI so a href="#" is an empty URI

Nope. herf="#" is not an empty URI, (well, the bit inside the "s isn't). It
is a URI consisting soley of an (according to the spec, or at least the
RFCs) invalid fragment identifier.
and we all know "an empty URI
reference within a document is interpreted as a reference to the start
of that document"

And we all know that just about all browsers interpret href="#" like that as
well.

The original thread(*) that prompted me to look that stuff up was about
reporting, as a bug, a browser that did not do that. There was a request to
cite the bit in the spec detailing what href="#" is supposed to do, so as to
srengthen the bug report. No such bit exists.

(*) Empty fragment identifier, <a href="#"> started by DU on June 28.
 
B

brucie

in post: <
But it does not talk about fragment identifiers, only TLDs.

everyone knows i really meant 2396
Nope. herf="#" is not an empty URI,

oh yes it is.
It is a URI

a fragment identifier (or its delimiter) is not part of a URI.
consisting soley of an (according to the spec, or at least the
RFCs) invalid fragment identifier.

its not a fragment identifier either. its a character used to seperate a
URI from a fragment identifier.
The original thread(*)
(*) Empty fragment identifier, <a href="#">

i don't have it
started by DU on June 28.

the day after my birthday!
 
R

rf

brucie said:
in post: <


i'd just like to make it clear that i blame my mother for smoking crack
when she was pregnant with me.

RFC2396

This RFC has changed the issue totally. Why do the bastards keep doing that?

It now seems that a fragment *may* be empty and href="#", and indeed href=""
point to the start of the current docuement. (section 4.2).
 
B

brucie

in post: <
This RFC has changed the issue totally. Why do the bastards keep doing that?
It now seems that a fragment *may* be empty and href="#", and indeed href=""
point to the start of the current docuement. (section 4.2).

on the other hand the html specs use rfc1808 so its not really fair to
use the updated 2396 as browsers are supposed to follow the html specs.
 
M

Mark Parnell

isn't it a bit short for such a contentious issue?

That's why it's being continued in the current thread. Plus you weren't
there to liven things up.
thanks! i'm very excited, i'm expecting pubes at any time now.

Get anything interesting? No, wait - I probably don't want to know.
 
J

Jukka K. Korpela

brucie said:
on the other hand the html specs use rfc1808 so its not really fair to
use the updated 2396 as browsers are supposed to follow the html specs.

HTML 4.01 also references RFC 2396 (in normative references), saying:
"Note that RFC 2396 updates [RFC1738] and [RFC1808]."
 
R

rf

Jukka K. Korpela said:
brucie said:
on the other hand the html specs use rfc1808 so its not really fair to
use the updated 2396 as browsers are supposed to follow the html specs.

HTML 4.01 also references RFC 2396 (in normative references), saying:
"Note that RFC 2396 updates [RFC1738] and [RFC1808]."

So, where does this leave us with our href="#" conundrum?

Yes, the spec clearly refers to rfc1808 where href="#" is invalid and
subject to error recovery by the UA. Nowhere does the spec nor rfc1808 state
what an empty fragment identifier does and this (brucie) is *not* an empty
URI. It is a URI with an invalidly empty fragment identifier.

However, as you say, the spec also references rfc2396 where the fragment
identifier is allowed to be empty, so we have href="#[empty]" being valid.
(the [empty] is my nomenclature, I couldn't think up anything better but it
is different to [undefined] which is also mentioned in rfc2396 as being
invalid: href="#[undefined]" seems to be IHMO to be invalid, one should only
add a # to a URI if one has a "defined" fragment to append thereto).

The two references are contradictory. The normative nature of the second
reference may help us out, being less, well, formative than the first
reference.

In any case (and at risk of being the ubiquitous "onlooker") "They" should
sort this one out. Definitively.

In the meantime I think the browsers have sorted it out for them :) What
comes first: the browser or the spec?
 
B

brucie

in post: <
rf said:
Nowhere does the spec nor rfc1808 state what an empty fragment
identifier does and this (brucie) is *not* an empty URI.

It is a URI with an invalidly empty fragment identifier.

# is not a fragment identifier or a URI

section 2.1 rfc1808

"Note that the fragment identifier (and the "#" that precedes it) is
not considered part of the URL."

section 2.4.1 rfc1808
"If the parse string contains a crosshatch "#" character, then the
substring after the first (left-most) crosshatch "#" and up to the
end of the parse string is the <fragment> identifier."

note that it says _after_ the # is the fragment identifier.
 
R

rf

brucie said:
in post: <

<stamps foot/> don't make me come down there!

http://users.bigpond.net.au/rf/foot.gif :)

"" is an empty URI.

"#" is not, under RFC1808 an empty URI.

It is a URI with a # in it, which indicates that a fragement indentifer must
follow the # but, according to RFC1808 that fragment identifier must *not*
be empty.

So, "#a" is a valid URI. It consists of a fragment identifier, the 'a', the
bit following the #.

"#" is not a valid URI as it does not supply the *required* fragment
qualifier. It is an invalid URI under RFC 1808 IMHO.
 
B

brucie

in post: <

lol, very sexy
"" is an empty URI. "#" is not, under RFC1808 an empty URI. It is a
URI with a # in it,

i think i'm going to have to put my hands on my hips and look menacingly
at you.
which indicates that a fragement indentifer must follow the # but,
according to RFC1808 that fragment identifier must *not* be empty.

"If the crosshatch is the last character, or no crosshatch is present,
then the fragment identifier is empty." 2.4.1
 
K

Kris

No. I really recall someone drumming up a specification that says that
there has to be a (non whitespace) character after the # character.

That was I.[/QUOTE]

[snip quote from that post]

Exactly that, yes!
 
J

Jukka K. Korpela

rf said:
HTML 4.01 also references RFC 2396 (in normative references),
saying: "Note that RFC 2396 updates [RFC1738] and [RFC1808]."

So, where does this leave us with our href="#" conundrum?

href="#" is technically correct and well-defined, since RFC 2396 trumps
RFC 1808.
The two references are contradictory.

It is part of the RFC system that an RFC may obsolete or update an older
RFC. In this context, "update" is to be understood in the sense of
overriding the content, since RFCs themselves are never changed.
 
Joined
Dec 7, 2012
Messages
1
Reaction score
0
I like to make a link in a web page to the page itself,
I've tried <a href=".">, but it open the directory. Thanks for any help.

Boy... based on the responses I've seen, the world is right... techie types can be pains the arses! Judst andswer the question guys! who really needs to know why this guy wants to do this? :bored:

The simplest solution which works in all browsers that support bookmarks (I believe they all do these days) is to create a bookmark toward the top of every html page, e.g.
<a name="thispage"></a>
and then in your href just refer to it, e.g.
<a href="#thispage">some arbitrary text here</a>

I use this when I'm creating web pages and publishing them in real time...don't have time to create "not implemented yet" type stuff for menus that are in place already - or gray out menu items, etc. so I just point the clickable area back to the same page. quick and neat till I can get all of it done.
:drky2:::wave:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top