Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Href to the current page

Reply
Thread Tools

Href to the current page

 
 
rf
Guest
Posts: n/a
 
      07-13-2004

"Jukka K. Korpela" <(E-Mail Removed)> wrote in message
news:Xns95258D0F11872jkorpelacstutfi@193.229.0.31. ..
> brucie <****@usenetshit.info> wrote:
>
> > 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?

--
Cheers
Richard.


 
Reply With Quote
 
 
 
 
brucie
Guest
Posts: n/a
 
      07-13-2004
in post: <news:KEPIc.92295$(E-Mail Removed)>
rf <rf@.invalid> said:

> Nowhere does the spec nor rfc1808 state what an empty fragment
> identifier does and this (brucie) is *not* an empty URI.


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

> 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.

--
b r u c i e


 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      07-13-2004

"brucie" <****@usenetshit.info> wrote in message
news:1iycmeac29h3n$(E-Mail Removed)...
> in post: <news:KEPIc.92295$(E-Mail Removed)>
> rf <rf@.invalid> said:
>
> > Nowhere does the spec nor rfc1808 state what an empty fragment
> > identifier does and this (brucie) is *not* an empty URI.

>
> <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.

--
Cheers
Richard.



 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      07-13-2004
in post: <news:52RIc.92417$(E-Mail Removed)>
rf <rf@.invalid> said:

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


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


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


--
b r u c i e


 
Reply With Quote
 
Kris
Guest
Posts: n/a
 
      07-13-2004
In article <ZhFIc.91506$(E-Mail Removed)>,
"rf" <rf@.invalid> wrote:

> > 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.


[snip quote from that post]

Exactly that, yes!

--
Kris
<(E-Mail Removed)> (nl)
 
Reply With Quote
 
Kris
Guest
Posts: n/a
 
      07-13-2004
In article <EDGIc.91579$(E-Mail Removed)>,
"rf" <rf@.invalid> wrote:

> > RFC2396

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


Well, then my response led to something useful after all.

--
Kris
<(E-Mail Removed)> (nl)
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      07-13-2004
"rf" <rf@.invalid> wrote:

>> 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.

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


 
Reply With Quote
 
all_is_well_in_NJ all_is_well_in_NJ is offline
Junior Member
Join Date: Dec 2012
Posts: 1
 
      12-07-2012
Quote:
Originally Posted by toufik toufik View Post
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?

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.
:
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to update the current web page? (delete current web page + rewrite the page) laryten@yahoo.com Javascript 3 10-12-2006 07:33 PM
href="javascript:func()" vs href="#" onclick="javascript:func()" CRON HTML 24 06-20-2006 08:05 PM
onClick method question (this.href and document.location.href) yogesh.bhardwaj@gmail.com Javascript 2 02-03-2005 02:38 PM
difference between location.href and window.location.href? saiho.yuen Javascript 3 09-14-2004 06:51 PM
Problem: Setting MSIE iframe innerHTML change relative href/src to absolute href/src Soren Vejrum Javascript 4 07-05-2003 01:47 PM



Advertisments