SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Back button

  1. #1
    SitePoint Zealot Kamran's Avatar
    Join Date
    Sep 2000
    Location
    UK
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I have a page, that many other sites link too. Is it possible to have one back button at the bottom of the page, which will take the visitors back to the site they came from?

    Will anyone know the code to this?

    Thanks

    Kam

  2. #2
    SitePoint Evangelist jazztie's Avatar
    Join Date
    Mar 2001
    Location
    the Netherlands
    Posts
    519
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just use a simple Javascript:
    -----
    <a href="#" onClick="history.go(-1)">Back</a>
    <input type=button value="Back" onClick="history.go(-1)">

    <!-- Change the value of -1 to any number of pages you would like to send your visitors back -->
    ---------

    Enjoy,

    also look for codes at http://www.javascript.com

  3. #3
    SitePoint Zealot Kamran's Avatar
    Join Date
    Sep 2000
    Location
    UK
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Thanks for the reply,

    If I wanted to add the code to an object (I'm using NetObjects Fusion 5) would I just put:

    <a href="#" onClick="history.go(-1)"a>

  4. #4
    SitePoint Evangelist jazztie's Avatar
    Join Date
    Mar 2001
    Location
    the Netherlands
    Posts
    519
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jep...
    just use the "<a href..." code on the object.

  5. #5
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    An alternative would be

    <a href="javascript:history.go(-1)">

    I think this works.

    This way, the link will still act like a link (ie it will have an underline, if your stylesheets give links an underline).

  6. #6
    SitePoint Zealot Kamran's Avatar
    Join Date
    Sep 2000
    Location
    UK
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help Jazztie and mmj

    All working now!

    Thanks again

    Kam


Bookmarks

Posting Permissions

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