Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

Href to the current page

 
 
toufik toufik
Guest
Posts: n/a
 
      07-12-2004
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.


 
Reply With Quote
 
 
 
 
Webcastmaker
Guest
Posts: n/a
 
      07-12-2004
In article <8gBIc.5867$(E-Mail Removed)>,
http://www.velocityreviews.com/forums/(E-Mail Removed) says...
> I like to make a link in a web page to the page itself,
> I've tried <a href=".">, but it open the directory.


Why not just have the href point to the page?

For example in a page named mypage.html why not have <a
href="mypage.html">Mypage</a>

Not sure what you are "really" trying to do, but that will accomplish
your request.

--
WebcastMaker
The easiest and most affordable way to create
Web casts, or put presentations on the Web.
www.webentations.com
 
Reply With Quote
 
 
 
 
Dylan Parry
Guest
Posts: n/a
 
      07-12-2004
toufik toufik wrote:

> I like to make a link in a web page to the page itself,


For what purpose?

--
Dylan Parry
http://www.webpageworkshop.co.uk - FREE Web tutorials and references

Now playing: Yes - The Gates Of Delirium [live][Symphonic Tour]
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      07-12-2004
toufik toufik wrote:

> I like to make a link in a web page to the page itself,


Whatever for? The user is already at the current page by the time they can
activate the link.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
toufik toufik
Guest
Posts: n/a
 
      07-12-2004
Thanks friends, I need this in a function that return an html text, I use it
in many area so it will be simple If I find something like "THIS" or "ME"...




"toufik toufik" <(E-Mail Removed)> wrote in message
news:8gBIc.5867$(E-Mail Removed).. .
> 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.
>
>



 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      07-12-2004
Dylan Parry <(E-Mail Removed)> wrote:

>> I like to make a link in a web page to the page itself,

>
> For what purpose?


That's what I wonder too, but anyway it is technically possible to do so
in several ways. The way to do it magically, without hard-coding the
page's URL onto the page itself, is to use
href="#"
By URL specifications, "#" is a reference to the start of the current
document.

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


 
Reply With Quote
 
Augustus
Guest
Posts: n/a
 
      07-12-2004

"toufik toufik" <(E-Mail Removed)> wrote in message
news:8gBIc.5867$(E-Mail Removed).. .
> I like to make a link in a web page to the page itself,
> I've tried <a href=".">, but it open the directory.


You could use:
<a href='#'>This Page</a>

But no guarantee that it works in every browser (I don't know if it does or
does not work in every browser... I had to do the same thing a year ago and
was using <a href='#'> and somebody said it might not work in every browser)

Best thing to do would be to use server side scripting to identify the
current page and then insert that in the HREF tag

In ASP it would be:
<a href='<%=request.serverVariables("script_name")%>' >This Page</a>

I'd presume every scripting language has something similar


 
Reply With Quote
 
Kris
Guest
Posts: n/a
 
      07-12-2004
In article <Xns9524EAD809FBBjkorpelacstutfi@193.229.0.31>,
"Jukka K. Korpela" <(E-Mail Removed)> wrote:

> By URL specifications, "#" is a reference to the start of the current
> document.


Is it? I remember in another thread very recently (sorry I cannot come
up with a ref to back that up) it was brought up that the behaviour of a
an empty fragment identifier is unspecified and hence unpredictable.

--
Kris
<(E-Mail Removed)> (nl)
 
Reply With Quote
 
Dylan Parry
Guest
Posts: n/a
 
      07-12-2004
Kris wrote:

>> By URL specifications, "#" is a reference to the start of the current
>> document.

>
> Is it?


Like Jukka says, "specifications". As we all know, not all browsers are
written to the standards, and as such the behaviour is unpredictable.

--
Dylan Parry
http://www.webpageworkshop.co.uk - FREE Web tutorials and references

Now playing: Yes - The Revealing Science of God - Dance of the Dawn
 
Reply With Quote
 
SpaceGirl
Guest
Posts: n/a
 
      07-12-2004
Augustus wrote:

> "toufik toufik" <(E-Mail Removed)> wrote in message
> news:8gBIc.5867$(E-Mail Removed).. .
>
>>I like to make a link in a web page to the page itself,
>>I've tried <a href=".">, but it open the directory.

>
>
> You could use:
> <a href='#'>This Page</a>
>
> But no guarantee that it works in every browser (I don't know if it does or
> does not work in every browser... I had to do the same thing a year ago and
> was using <a href='#'> and somebody said it might not work in every browser)
>
> Best thing to do would be to use server side scripting to identify the
> current page and then insert that in the HREF tag
>
> In ASP it would be:
> <a href='<%=request.serverVariables("script_name")%>' >This Page</a>
>
> I'd presume every scripting language has something similar
>
>


Two people have said that, but I've yet to find a browser that people
are actually using that doesn't support it. IE, Mozilla, Netscape, Opera
- all versions, all platforms support it. Perhaps in an accessiblity
thing? Too tired to go checkin', sorry. If it's not that, then it's not
worth worrying about. # is just fine.

--


x theSpaceGirl (miranda)

# lead designer @ http://www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #
 
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