Questions tagged [back-button]

A button that will take the user back to the previous state that they were on.

A back button, often depicted with leftward facing arrow icon, is a basic control that allows the user to return to a previous application state.

In web browsers, a historical record of each time a user navigates to a new page is kept. Clicking the browser's back button will return the user to the previous page in the history.


For example, if a user navigates first to google.com (1) then to facebook.com (2) then to youtube.com (3), their browsing history will include all the pages they visited at each site in the order they were viewed (1, 2, 3).

While on youtube.com (3), if the user clicks the back button, they will then be taken to facebook.com (2). If they click the back button again, they will be taken to google.com (1).

1630 questions
50
votes
11 answers

JavaScript or jQuery browser back button click detector

Could someone please share experience / code how we can detect the browser back button click (for any type of browsers)? We need to cater all browser that doesn't support HTML5
Nil Pun
  • 17,035
  • 39
  • 172
  • 294
49
votes
3 answers

How to trigger change when using the back button with history.pushstate and popstate?

I'm pretty much a novice when it comes to js so I'm sorry if I'm missing something really simple. Basically, I've done some research into using the history.pustate and popstate and I've made it so a query string is added to the end of the url…
Rwd
  • 34,180
  • 6
  • 64
  • 78
49
votes
2 answers

Avoid back button on JSF web application

I am showing VERY sensitive data. After the user logs out from my server I don't want another user to be able to see the data hitting the Back button of the browser. How can I achieve this?
Tony
  • 10,088
  • 20
  • 85
  • 139
48
votes
12 answers

How to exit when back button is pressed?

When a user presses the back button on an intent, the application should quit. How can I ensure the application quits when the back button is pressed?
d-man
  • 57,473
  • 85
  • 212
  • 296
42
votes
12 answers

How to change color of back button on NavigationView

When you click on the button it takes you to a new view and puts a back button in the top left. I can't figure out what property controls the color of the back button. I tried adding an accentColor and foregroundColor but they only edit the items…
Michael St Clair
  • 5,937
  • 10
  • 49
  • 75
42
votes
11 answers

Change UINavigationBar back button title

In my application I want to use 'Back' text as back button title for every viewcontroller. I have read so many posts on stackoverflow but got nothing. I don't want to set leftbarbuttonitem. Can anyone help me on this simple task. Thanks,
S S
  • 646
  • 1
  • 7
  • 16
41
votes
6 answers

browser back acts on nested iframe before the page itself - is there a way to avoid it?

I have a page with dynamic data loaded by some ajax and lots of javascript. the page contains a list from which the user can choose and each selected value loads new data to the page. One of these data items is a url provided to an iframe. I…
kfiroo
  • 1,913
  • 2
  • 15
  • 18
41
votes
5 answers

PhoneGap - android exit on backbutton

I am trying to program RSS reader using jquery mobile and cordova. My RSS reader consists of 3 pages (in same HTML document: page1, page2, page3). I am trying to override (hardware)backbutton behaviour so it would exit the program. To check that I…
horin
  • 1,664
  • 6
  • 23
  • 52
39
votes
13 answers

Android: Quit application when press back button

In my application i want exit from app when press back button, this my code: @Override public void onBackPressed() { new AlertDialog.Builder(this).setIcon(android.R.drawable.ic_dialog_alert).setTitle("Exit") …
Elham Gdz
  • 1,015
  • 3
  • 15
  • 31
31
votes
12 answers

Disabling Back button on the browser

I am writing an application that if the user hits back, it may resend the same information and mess up the flow and integrity of data. How do I disable it for users who are with and without javascript on?
Haoest
  • 13,610
  • 29
  • 89
  • 105
31
votes
5 answers

Android back button and MediaController

I know how to take control of the back button. I have a VideoView embedded in a FrameLayout. My question is when the video pops up, the video controls are present for a few seconds. Hitting the back button while they are visible hides the video…
Ronnie
  • 11,138
  • 21
  • 78
  • 140
30
votes
15 answers

How to disable Browser back button in Angular 2

I'm developing a web site using Angular 2. Is there any way to disable or trigger Browser back button using Angular 2? Thanks
DAN
  • 3,140
  • 5
  • 20
  • 22
29
votes
7 answers

ASP.NET authentication login and logout with browser back button

I am looking for a solution for user use the browser's back button to navigate to previous page once logged out. I have a web application build in asp.net and using a custom membership provider for authentication and authorization. Everything works…
Eatdoku
  • 6,569
  • 13
  • 63
  • 98
28
votes
6 answers

Can I update window.location.hash without having the web page scroll?

Using JavaScript, is there a way to update window.location.hash without scrolling the web page? I have clickable title elements that toggle the visibility of a div directly beneath them. I want the /foo#bar in the history when clicking titles but…
Jonathon Watney
  • 20,248
  • 9
  • 38
  • 40
27
votes
4 answers

Flutter how to execute when clicking back button

I have a page that is called from bottom tab nav which executes a initState function, I then navigate to a page via button click that has details and actions to take, however when I click the back button to goto originating page, the initState does…
Robert
  • 5,347
  • 13
  • 40
  • 57