|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
In previous posts, I've answered the subject question by saying:
****************************************** I don't believe you can actually disable the 'Back' button. But you can delete the history object rendering the 'Back' button useless. <a href="#" onclick="window.location.replace(url)"> This line of HTML code refreshes the current page AND deletes all history; so there's nothing to which to go back! ******************************************* After reading other posts stating this doesn't work, I've been investigating. Both NS and IE document this as I stated above [between the asterisked lines]. However, we've not been able to get it to work properly. Either the documentation is wrong (Both browsers??) or there is some little 'trick' to doing this. This 'method' of deleting history is under investigation and I will keep this list posted as to the results. Russ |
|
#2
|
|||
|
|||
|
Well if you are using the # to null out the href that is probably where you are having problems. Try putting the replace method in the href instead and you shouldn't have any problems.
<a href="javascript:window.location.replace('nextpage.html');"> Spookster ------------------ Visit the WSAbstract Help Forum for your Javascript, DHTML, or General Web Design Questions |
|
#3
|
|||
|
|||
|
How would this work with a form that is being auto-submitted: i.e., document.form.submit()?
I have an application (perl-cgi with embedded javascript) that takes the CC information that has been entered on the final screen, does some processing (saves the CC information), then auto-submits a form with the hidden fields necessary to send to the CC processor. When it returns from the CC processor, the visitor receives a confirmation screen. If they would press the browser back button, the form would actually be re-submitted - and I don't have the ability to do any checks to prevent that (it doesn't go back to the routine that builds the form and submits it - it returns to the actual form submission itself, and is re-submitted to the CC processor). In this scenario - it doesn't appear that the location replace() method would work(especially since this is cgi-driven). Isn't there a way when a page is loaded to provide for the detection of the browser back button being pressed, like you can when you are trying to detect (for instance) a mouse right-click? scratching my head...... Sharon |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Disabling the Back Button - Error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|