Kris said:
Like Jukka says, "specifications". As we all know, not all browsers are
written to the standards, and as such the behaviour is unpredictable.
No. I really recall someone drumming up a specification that says that
there has to be a (non whitespace) character after the # character.[/QUOTE]
That was I.
<quote>
My feeling is that it is an error condition. The spec talks about what to do
with a fragment identifier that is incorrect (perhaps misspelt) but not
about one that is simply missing.
<researches>
RFC1738 talks about fragment/anchor identifier but only that it might be
there (including the #).
RFC1808 mentions fragment identifier by pointing out that "a parser must be
able to recognise the fragment when it is present".
Aha, RFC1808, in section 2.2 defines in modified BNF form
"fragment = 1*pchar"
and mentions that the 1* means "[one] or more repetitions of the [pchar].
So, zero repetitions is not allowed and href="#" is therefore an error.
Since it is an error then the browser, as per the spec, is at liberty to
interperet it as the browser sees fit. There is no "correct" behaviour.
</quote>