User defined back/forward buttons
Moderator: General Moderators
User defined back/forward buttons
Instead of using the browser back/forward buttons, I want to create my own on the web page. Anyone have an idea as to how this is accomplished?
-
daniel142005
- Forum Newbie
- Posts: 3
- Joined: Sat Sep 20, 2008 3:32 pm
Re: User defined back/forward buttons
The easiest way would be to use javascript.
Example:
You could also use something like:
You can change the -1 and 1 to any number, This allows you to determine how far forward or back to take the viewer. Use a minus sign and a number to go back, or just a number to go forward.
The onclick can be applied to almost all html elements, img, a, div, etc.
Example:
Code: Select all
<FORM>
<INPUT type="button" value="Click here to go back" onClick="history.back()">
<INPUT type="button" value="Click here to go forward" onClick="history.forward()">
</FORM>Code: Select all
<FORM>
<INPUT type="button" value="Click here to go back" onClick="history.go(-1)">
<INPUT type="button" value="Click here to go forward" onClick="history.go(1)">
</FORM>The onclick can be applied to almost all html elements, img, a, div, etc.
Re: User defined back/forward buttons
This is beautiful code, clear straightforward. Only problem is when I run a page with it the machine gives that snarky "Done, but with errors" message and the buttons do not appear.
Does anyone know a way of making HTML errors visible or seeing the error log?
Does anyone know a way of making HTML errors visible or seeing the error log?