Javascript Back Button - Stop the initial load of back button from working
Posted
by Evan
on Stack Overflow
See other posts from Stack Overflow
or by Evan
Published on 2010-05-29T16:22:06Z
Indexed on
2010/05/29
16:32 UTC
Read the original article
Hit count: 455
Hi,
I'm using a javascript back button link and forward button link to control the user's history inside a modal/lightbox window.
The challenge I have is when the modal window is launched, and the "back" and "forward" buttons are present for the user to click, if the initial javascript back button is clicked when the window opens, it actually closes the modal window, because the javascript history is taking the user back to the page PRIOR to the opening of modal window.
So, in essence, I'm trying to disable the "back" button from working on the initial load of the modal/light box.
<a href="javascript:history.go(-1)">Back Button</a>
<a href="javascript:history.go(1)">Foward Button</a>
Is this possible?
© Stack Overflow or respective owner