Is there simple syntax available to program a "back" button, or is this a complex matter?
Kind regards,
Is there simple syntax available to program a "back" button, or is this a complex matter?
Kind regards,
Something like this:
Hope this helps.Code:<input type="button" value="Back" onclick="history.go(-1);">
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
Not in HTML. But yes, as thetestingsite says, it is pretty simple in javascript, but there are limitations. You cannot get any information about the history, and there are no guarantees that there will be a history to go to, and it requires javascript enabled - those without javascript enabled will get nothing from a button of that sort.
For the vast majority of occasions, this is something best left to the browser - it has a back button right on it.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
You could also make it disabled if you haven't had any history yet in that session. Right?
Jeremy | jfein.net
Not really, you can ask for:
history.length
But the precision (+-1) varies with browsers, and once established includes both forward and backward history, so if you were at the start page, with nowhere back to go, but had made 26 forward moves before using back to get back to that page, the length would still be 26, even though there was nowhere back to go.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Bookmarks