Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   Back button (http://www.velocityreviews.com/forums/t162311-back-button.html)

Ted 07-28-2005 03:07 AM

Back button
 
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



Mark Parnell 07-28-2005 03:20 AM

Re: Back button
 
Previously in alt.html, Ted <edward@clarkeedward.wan.rubbish.adoo.co.uk>
said:

> What I want is to just simulate the 'Back' button.


Why? My browser already has one.

--
Mark Parnell
http://www.clarkecomputers.com.au
alt.html FAQ :: http://html-faq.com/

Roy Schestowitz 07-28-2005 04:18 AM

Re: Back button
 
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

Benjamin Niemann 07-28-2005 08:37 AM

Re: Back button
 
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/

Ted 07-28-2005 03:20 PM

Re: Back button
 
>> 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




Dan 07-29-2005 01:40 AM

Re: Back button
 
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



All times are GMT. The time now is 05:40 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57