![]() |
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 |
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/ |
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 |
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/ |
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 |
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.