tags:

views:

26

answers:

2

I have a chat application,i want to disable the back and forward option of browser so that user cannot move back or forward.It shold be compatible in all browsers.

+4  A: 

Not possible. You should not try to interfere with browser features. You should instead code your application to deal with a user freely going back and forward.

redsquare
A: 

You cannot disable buttons belonging to the browser and you should leave your visitors the choice to use your website like they see fit.

For instance look at Facebook's chat functionality. If you chat and then nagivate away from the page, the chat panel will reopen on the new panel and load the chat history again. This is a much clearner solution and doesn't interfere with the browser's back and forward buttons.

Mythica
Mythica plz tell what could be the best solution for this problem.my problem is that i m storing the session of user in jsp page.how can i load the application again and track the session
Surely that is seamless as the sessionid is stored as a cookie on the browser?
redsquare
Since HTTP is stateless, you usually have a cookie with a session identifier on the client. Using that identifier you can look up the user's session and retrieve the chat history from the database on the server (for instance, if the chat app is written in jQuery, request the data using an ajax call).
Mythica