473,396 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

disabling browser back button

Hi all,
This is Vikram kumar.
In my application i want to disable browser back and forward button using
javascript.
Please help me,
Thanks.
Mar 17 '08 #1
4 2337
gits
5,390 Expert Mod 4TB
hi ...

in case you really need this 'annoying' override of well known and useful browser-behaviour you may play around with something like this

kind regards
Mar 17 '08 #2
acoder
16,027 Expert Mod 8TB
You can't really disable the back button, but you can use onbeforeunload to warn the user that they will lose important information if not saved (in a web application).

The link only provides tricks. You can also use location.replace to prevent entries in the history.
Mar 18 '08 #3
gits
5,390 Expert Mod 4TB
You can't really disable the back button, but you can use onbeforeunload to warn the user that they will lose important information if not saved (in a web application).

The link only provides tricks. You can also use location.replace to prevent entries in the history.
yup ... that is true ... :) the best way would just be to not avoid or workaround 'browser-provided' functionalities but to integrate them in the application ... since the browser is the platform for the application and thus it builds the 'application framework' for the webapp ... it is a bit a philosophical question and my personal point of view is that what i said :) ... even though there are some useful statements from a user-interface-design view that states that we shouldn't avoid or suppress the standards-behaviour of applications that a user always uses and has learned to use it a way that a application allows him to ... so as an example it would be a bad design if the user clicks the back-button of the browser where he expects to get to the page before ... but instead the 'embedded' application sends him to a page he never wanted to visit ... and much worser ... now he wants to go back and the forward button has a new assigned behaviour and he will not know how to get to the page where his journey began :) ...

kind regards
Mar 18 '08 #4
acoder
16,027 Expert Mod 8TB
Good points especially about the browser being the platform for the application.

In fact, in Ajaxy applications, developers want to return the back button functionality to the application since it's so useful. Very rarely do you need to disable the back button. Usually all that is needed is to prevent the page being cached and user authentication so that the user cannot view previous pages when logged out and good use of onbeforeunload (where supported) to prevent loss of unsaved data.

This question has been asked a number of times, so Frinavale has begun a soon-to-be article here.
Mar 18 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: jcnews | last post by:
When designing a webpage, is there a way to disable the back button? It must be possible. I am asking because there are certain web applications that I have used that require the user to...
2
by: Jeelz | last post by:
Hi Guyz, Would appriciate any tip on disabling an ASP.NET LinkButton using client sided code like javascript. My Requirement is such that the user should be allowed to click on the link...
1
by: cgia | last post by:
Is it possible to disable the back button of the browser application-wide? Or it must be done in each form? In any case, how?
2
by: Kapil Jain | last post by:
Dear All, I would like to disable back and forward button + Refresh button. Please help in doing this. I want this because i am displaying data from mysql database and on back and forward button...
5
by: ns21 | last post by:
How can the browser back button be disabled If the form is submitting information to other pages or submitting to itself or using redirections. I tried the tweaks like history.forward(1) in each...
11
by: shankwheat | last post by:
I have a function which passes text from txtdebt to debtsbox which works fine. However, I want to add code which examines the value of debtsbox and if any of the values the user entered contain the...
0
by: toeffetommy | last post by:
Hello, I need a piece of functionality developed for our Website and I need some technical advice on how get there. Essentially, what I want to develop is a browser-within-browser...
3
by: =?Utf-8?B?cHJhZGVlcF9UUA==?= | last post by:
Hi All, Can anyone please explain me why I am not able to disable Browser caching in ASP.net by writing the following code Response.Buffer = true; Response.ExpiresAbsolute =...
6
by: raam | last post by:
hi, I have an applciation where when i click on "Logout" should disable back button of browser.The page redirects to defaultlogin screen.There the buttons should get disabled. Can any one expalin...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.