Back button

Discussion in 'HTML' started by Ted, Jul 28, 2005.

  1. Ted

    Ted Guest

    Greetings gents
    In IE6 the 'Back' button returns one to the SAME POSITION in the previous
    page.
    How do I write that in html? I know about <a href="../pagename.htm">Back</a>
    but that is to a specific page and puts cursor at the beginning.
    What I want is to just simulate the 'Back' button.
    Thanks for any ideas.
    Ted
    Ted, Jul 28, 2005
    #1
    1. Advertising

  2. Ted

    Mark Parnell Guest

    Mark Parnell, Jul 28, 2005
    #2
    1. Advertising

  3. Ted wrote:

    > Greetings gents
    > In IE6 the 'Back' button returns one to the SAME POSITION in the previous
    > page.
    > How do I write that in html? I know about <a
    > href="../pagename.htm">Back</a> but that is to a specific page and puts
    > cursor at the beginning. What I want is to just simulate the 'Back'
    > button. Thanks for any ideas.
    > Ted


    Have a look at the following. You might have to involve JavaScript.

    http://www.foad.org/~abigail/HTML/Misc/back_button.html

    --
    Roy S. Schestowitz
    http://Schestowitz.com
    Roy Schestowitz, Jul 28, 2005
    #3
  4. Ted wrote:

    > Greetings gents
    > In IE6 the 'Back' button returns one to the SAME POSITION in the previous
    > page.
    > How do I write that in html? I know about <a
    > href="../pagename.htm">Back</a> but that is to a specific page and puts
    > cursor at the beginning. What I want is to just simulate the 'Back'
    > button. Thanks for any ideas.


    You can't do this with HTML alone. You might use
    <a href="../pagename.htm" onclick="window.back()">Back</a>
    which will work just like the back button in JavaScript enabled browsers. In
    browsers without JavaScript the browser will always
    a) load '../pagename.htm' which may not be the previous page in the browsers
    history - there are always other way to open a page, even if you think that
    there's only one link on one page. Thus there will be a totally different
    behaviour between JS and non-JS browsers for the save link.
    b) jump to the top of the page. You might use a fragment
    '../pagename.htm#someID', but there's no way to determine which element was
    closest to the current position.

    --
    Benjamin Niemann
    Email: pink at odahoda dot de
    WWW: http://www.odahoda.de/
    Benjamin Niemann, Jul 28, 2005
    #4
  5. Ted

    Ted Guest

    >> How do I write that in html? I know about <a
    >> href="../pagename.htm">Back</a> but that is to a specific page and
    >> puts cursor at the beginning. What I want is to just simulate the
    >> 'Back' button. Thanks for any ideas.

    >
    > You can't do this with HTML alone. You might use
    > <a href="../pagename.htm" onclick="window.back()">Back</a>


    Thanks for that. I didn't really want users to have to enable jscript...
    Works fine but goes to top of page, as you said.

    <a href = "javascript:history.back()"> Go back </a>
    Works just like 'Back' button. Nice.

    So, those without jscript enabled can use the back button
    while the more adventurous will see my 'go back'.

    Thanks all. You've helped a lot.
    Ted
    Ted, Jul 28, 2005
    #5
  6. Ted

    Dan Guest

    Ted wrote:
    > > You can't do this with HTML alone. You might use
    > > <a href="../pagename.htm" onclick="window.back()">Back</a>

    >
    > Thanks for that. I didn't really want users to have to enable jscript...
    > Works fine but goes to top of page, as you said.
    >
    > <a href = "javascript:history.back()"> Go back </a>
    > Works just like 'Back' button. Nice.
    >
    > So, those without jscript enabled can use the back button
    > while the more adventurous will see my 'go back'.


    That's not really an improvement... the other person's example
    gracefully degraded to an ordinary link if JavaScript was not enabled,
    while your version will merely produce an error in that case. And
    those without JavaScript will see it... it just won't work.

    --
    Dan
    Dan, Jul 29, 2005
    #6
    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. sylvia sil
    Replies:
    1
    Views:
    593
    Curt_C [MVP]
    Dec 29, 2004
  2. Chicagoboy27

    image button as a back button

    Chicagoboy27, Oct 26, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,995
    Chicagoboy27
    Oct 30, 2006
  3. phancey
    Replies:
    3
    Views:
    2,570
  4. Author
    Replies:
    6
    Views:
    3,065
    George
    Jan 22, 2009
  5. Useful Info

    Firefox back button takes me back 2 pages.

    Useful Info, Jun 3, 2007, in forum: Javascript
    Replies:
    0
    Views:
    332
    Useful Info
    Jun 3, 2007
Loading...

Share This Page