i want to disable forward and back button of IE in jsp page

It is not possible you cannot control browser buttons from JSP/Javascript

technically true. But you could keep a record of where the user has been and when trying to get to the previous (next in that case wouldn't ever happen) URL simply reload the page they're on.

Hi jwenting, woudnt the user get confused when he/she clicks on back button and the current page reloads?
Could you elaborate more on this approach?


Also, long back had tried using

window.location.replace

but was not satisfied with it. Maybe was not able to implement it properly.

If you could shed more light on it, it would be useful as this is a very common scenario to deal with in web applications

i want to disable forward and back button of IE in jsp page

Perhaps it would be better to tell us WHY you want to disable the forward/back button. Maybe what you are trying to achieve can be done in another way than disabling the buttons.

Hi jwenting, woudnt the user get confused when he/she clicks on back button and the current page reloads?

Probably, but it would have the desired effect :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.