back link

Discussion in 'Javascript' started by prophet, Jan 26, 2007.

  1. prophet

    prophet Guest

    Here is a simple on that I need help with.....

    I need to create a link "back" that when you click it, it returns you back
    to the previous page that you were at.

    I am not looking for button which I know how to do - <FORM><INPUT
    TYPE="button" VALUE="Back" onClick="history.go(-1);return true;"></FORM>

    I an looking to do it as if it was a hyperlink.

    Thank you.
    prophet, Jan 26, 2007
    #1
    1. Advertising

  2. On Jan 26, 6:45 am, "prophet" <> wrote:
    > Here is a simple on that I need help with.....
    >
    > I need to create a link "back" that when you click it, it returns you back
    > to the previous page that you were at.
    >
    > I am not looking for button which I know how to do - <FORM><INPUT
    > TYPE="button" VALUE="Back" onClick="history.go(-1);return true;"></FORM>
    >
    > I an looking to do it as if it was a hyperlink.
    >

    <a href="javascript:void(history.back())">back</a>

    Though ideally you'd use a proper URL as a "href" as a fallback for
    agents with JS turned off and put the JS code in an onclick handler.

    Nickolay
    Nickolay Ponomarev, Jan 26, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joby
    Replies:
    0
    Views:
    1,615
  2. sylvia sil
    Replies:
    1
    Views:
    597
    Curt_C [MVP]
    Dec 29, 2004
  3. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    797
    Kevin Spencer
    May 17, 2005
  4. =?Utf-8?B?Z29yaWxsYQ==?=
    Replies:
    1
    Views:
    753
    Masudur
    May 25, 2007
  5. Author
    Replies:
    6
    Views:
    3,069
    George
    Jan 22, 2009
Loading...

Share This Page