Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.history.back

Status
Not open for further replies.

cat5ive

MIS
Joined
Dec 3, 2004
Messages
184
Location
US
Hi,

How to use the history.back property? I tried to put the event handler with my 'cancel' button. When I click cancel, it took me the the previous page as I wanted but then it took me back to the 2nd page again. What's wrong with the code? Please help.

Thank in advance.
Code:
function cancel()
   		{
		   window.history.back();
		}

<td align="right"><input type="image" src="images/cancel.gif" border="0" onclick="cancel();"></a></td>

 
It's gave me the same result. Here is my code now.
Code:
<td align="right"><input type="image" src="images/cancel.gif" border="0" onclick="javascript: history.go(-1)"></a></td>

Thanks
 
Code:
<td align="right">
	<a href="javascript:history.go(-1)">
		<img src="images/cancel.gif" border="0">
	</a>
</td>

M. Brooks
 
Perfect! Thank you M.Brooks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top