Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Browser buttons


Message #1 by "marc cardenas" <marclena@h...> on Fri, 7 Mar 2003 17:44:40
Hi

Actually you can do a semi-disabling of back button at least in MSIE 4.0+
browsers :-)

If you use the window.onbeforeunload or document.body.onbeforeunload event
then you have a chance of writing information to the user prompting he for
an "ok" or a "cancel" ("ok" will be the default choice).

If the user chooses OK then the back function will take place otherwise
pressing the CANCEL will actually STOP an attempt to go back...!

Please note the information on this page (in MSDN) which will point out
exactly when this event is evoked. For instance you might not be
interessted in this message popping up every time a user replaces the URL
by just clicking an a link on your page :-)

It's all here at MSDN:
http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onbeforeunload.asp

Med venlig hilsen (that is: Cheers in english)

Sten Hougaard
EDB Gruppen
Application developer/web-designer



                                                                                                                   
                    Mark Eckeard                                                                                   
                    <meckeard2000@       To:     "JavaScript HowTo" <javascript_howto@p...>                
                    yahoo.com>           cc:                                                                       
                                         Subject:     [javascript_howto] Re: Browser buttons                       
                    07-03-2003                                                                                     
                    18:36                                                                                          
                    Please respond                                                                                 
                    to "JavaScript                                                                                 
                    HowTo"                                                                                         
                                                                                                                   
                                                                                                                   




Marc,

You can't.

Mark.
--- marc cardenas <marclena@h...> wrote:
> Hi,
> Does anyone knows how can I disable the back button
> on the browser, so the
> users cannot go back?
> Thanks

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/





  Return to Index