Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Senior Member hagen's Avatar
    Join Date
    Aug 2005
    Posts
    408
    Member #
    10882
    Liked
    1 times
    Hi, I would like a page with a link on it that when I click, it jumps to itself using an html / css link...

    IE somthing like:

    href="."

    I don't want to explicitly declare the file names as i want it to be generic for whatever page i am on...

    and ideas??

    Cheers -Hagen
    Hagen Rose: hagen(at)jxwd(dot)co(dot)uk
    JX Web Development, Bournemouth, Dorset...JXWD.co.uk

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Using html and css alone, I do not think so..

    With JavaScript, yes.

  4. #3
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,720
    Member #
    5580
    Liked
    718 times
    There is a way ... but it's a PHP method.

    That means, you would have to change your extensions from .html to .php

    Inside that HTML file (for example: index.php), you would insert this:

    <?php
    $url=$_SERVER['PHP_SELF'];
    echo "<a href='$url'>Re-display this page</a>";
    ?>


    The link becomes a link to itself ... no matter what the URL is.
    The advantage of PHP of course, is that you could send variables
    back to itself and utilize other PHP sections to process variables.
    Sort of a dynamic, change-on-the-fly type of thing. If anyone
    has Javascripting turned off, it would still work OK.

    =====================

    Doing it with Javascripting?
    http://www.google.com/search?q=javas...arch&hl=en&lr=


    .


  5. #4
    Senior Member hagen's Avatar
    Join Date
    Aug 2005
    Posts
    408
    Member #
    10882
    Liked
    1 times
    Yeah, I already did that in the intrium, but I want to know just for record how to do it in css / html...

    Thanks -Hagen
    Hagen Rose: hagen(at)jxwd(dot)co(dot)uk
    JX Web Development, Bournemouth, Dorset...JXWD.co.uk

  6. #5
    Senior Member
    Join Date
    Apr 2005
    Location
    Hatfield, England
    Posts
    855
    Member #
    9790
    I have probably completely misunderstood the question but don't you just need to do href="#" That will take you to the same page

  7. #6
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    "#" is just for a dummy link, to call a client side scripting function, or similar.

  8. #7
    Senior Member Arkette's Avatar
    Join Date
    Jan 2006
    Location
    Europe
    Posts
    102
    Member #
    12297
    I've got ask this: why if a client is already viewing a page, does he need a link to reload the same page?
    End of Line.

  9. #8
    Senior Member
    Join Date
    May 2005
    Location
    Essex, United Kingdom
    Posts
    200
    Member #
    10131
    Quote Originally Posted by bfsog
    "#" is just for a dummy link, to call a client side scripting function, or similar.
    Oh no it isn't href="#" is used for bookmarks actually. E.g.
    Code:
    <div id="content">Content Here</div>
    <p><a href="#content">Go To Content</a></p>
    Just a href="#" will return the user to the top of the page. You could pass a dummy querystring, e.g.
    Code:
    <a href="?a=a">Reload Page</a>
    Although this has the obvious side effect of passing a non-meaningful querystring.

    Javascript Option
    Code:
    <a href="javascript:location.reload(true)">Reload Page</a>
    Hope this is useful


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

how to link a page to itself html
,
how to link to itself in html
,

href to itself

,

href to page itself

,

html link page itself

,
html link within a page itself
,

link to itself html

,
page lkink to itself
,
php itself hyperlink
,
web link to itself href
Click on a term to search for related topics.
All times are GMT -6. The time now is 03:12 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com