PDA

View Full Version : Back and Foward.



Lee
09-17-2004, 03:50 PM
I have this code in my page
<td><form><input type ="Button" VALUE = "back" onclick="history.go(-1)"></form></td>

<form><input type ="Button" VALUE = "Forward" onclick="history.go(+1)"></form>

they make a NICE Back and Foward button... but my customer wants a IMAGE instead... How do I do that ?

simonf
09-20-2004, 04:04 AM
<IMG style="CURSOR: hand" onclick=history.back()
height=17 alt="Back to Previous Page"
src="images/but_previous.jpg" width=81 border=0>

gigabites
09-21-2004, 01:10 AM
This will work too:


<a href=# onClick="history.go(-1)"><img src="images/back.gif" alt="back"></a>
<a href=# onClick="history.go(+1)"><img src="images/forward.gif" alt="forward"></a>

delvin
08-21-2005, 01:08 PM
I have tried the code suggested in these replies and also tried adjusting it in various ways to get my back button to work and it just wont

this is the original HTML to take me to a specific page

<td><a href="../../garments.htm" target="_top" onClick="MM_nbGroup('down','group1','back','../../Images/Buttons/back3.gif',1)" onMouseOver="MM_nbGroup('over','back','../../Images/Buttons/back2.gif','',1)" onMouseOut="MM_nbGroup('out')"><img src="../../Images/Buttons/back1.gif" alt="" name="back" width="116" height="70" border="0" onload=""></a></td>

This was ok when you could only access the page from one point but now it can be accessed from various places within the website its no good and i need it to be a smple 'Back' button

can you tell me what i need to do to achieve this please
:)

darco9x2
08-21-2005, 03:32 PM
they can't just use the back/forward button on the brower?

delvin
08-21-2005, 04:50 PM
Yes but this is a part of the navigation bar and ease of navigation helps to make a site user freindly :)

Twey
08-21-2005, 05:00 PM
<a href="javascript:history.go(-1);">Back</a>
<a href="javascript:history.go(1);">Forward</a>

delvin
08-21-2005, 06:29 PM
Its not working :confused:

All i get when i click on the link is

Not Found
The requested URL /Garments/Household/"javascript:history.go(-1);">Back was not found on this server.

Which is what was happening before.

mwinter
08-21-2005, 08:35 PM
they can't just use the back/forward button on the brower?
Yes but this is a part of the navigation barWhat difference does that make?

Darco is absolutely right. The browser already provides this feature, and it does so reliably and consistently. An author cannot hope to acheive that, so don't try.


and ease of navigation helps to make a site user freindlyReimplementing a standard feature badly does nothing but harm usability.



<a href="javascript:history.go(-1);">Back</a>
<a href="javascript:history.go(1);">Forward</a>At the very least you should have suggested that the OP include that using a document.write call so that users without scripting support don't get links that do nothing (or worse, indicate an error as they don't recognise the javascript: pseudo-scheme).

Mike

Twey
08-21-2005, 09:23 PM
At the very least you should have suggested that the OP include that using a document.write call so that users without scripting support don't get links that do nothing (or worse, indicate an error as they don't recognise the javascript: pseudo-scheme).
You're right, of course.

<script type="text/javascript">
document.write('<a href="javascript:history.go(-1);">Back</a> ');
document.write('<a href="javascript:history.go(1);">Forward</a>');
</script>
I also agree that creating your own navigation bar is useless.

The requested URL /Garments/Household/"javascript:history.go(-1);">Back was not found on this server.
Sounds like you've missed a quote somewhere.

delvin
08-21-2005, 09:30 PM
The browser already provides this feature, and it does so reliably and consistently. An author cannot hope to acheive that, so don't try.

Mike

So does this mean that every site that uses a 'back' button is using it to directly link to a specific page? as i was doing in my original HTML above.



I also agree that creating your own navigation bar is useless.

Twey

Surely not, while I can see that recreating the functions already available within the browser is perhaps superfluous, every site of more than one page has to have a navigation method (in this case a navigation bar) or else it is impossible to use the site

Twey
08-23-2005, 11:20 AM
I meant a bar similar to the browser's navigation bar. Site-specific functions, of course, are useful.

mwinter
08-23-2005, 03:31 PM
So does this mean that every site that uses a 'back' button is using it to directly link to a specific page?Why not? There are three ways to track user movement from the server: cookies, the Referer [sic] header, and the query string (this being the safest, but most intrusive). If the user arrived at the URL from a form, then you have a fourth (POST data). You can then serve the common document with a link generated from this information. However, this is just a convenience mechanism, and there should be nothing wrong with directing the user to use their Back button.

Mike