Questions tagged [browser-history]

Browser history refers to the list of web pages a user has visited recently—and associated data such as page title and time of visit—which is recorded by web browser software as standard for a certain period of time.

Browser history refers to the list of web pages a user has visited recently, and associated data such as page title and time of visit, which is recorded by web browser software as standard for a certain period of time.

Web browser software does this in order to distinguish already visited links, to provide the user with a Back button and/or a History list, to go back to pages they have visited previously, rather than relying on the user to remember where they have been on the web.

More on this here. For information about different types of browsers, click here.

1568 questions
225
votes
16 answers

How to get notified about changes of the history via history.pushState?

So now that HTML5 introduces history.pushState to change the browsers history, websites start using this in combination with Ajax instead of changing the fragment identifier of the URL. Sadly that means that those calls cannot be detect anymore by…
Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143
109
votes
5 answers

How do I pass state through React_router?

Here is the file that's causing me trouble: var Routers = React.createClass({ getInitialState: function(){ return{ userName: "", relatives: [] } }, userLoggedIn: function(userName, relatives){ this.setState({ …
Jonas Bergner
  • 1,663
  • 4
  • 15
  • 22
107
votes
4 answers

Can you use hash navigation without affecting history?

I'm afraid it might be impossible but is there a way to change the hash value of a URL without leaving an entry in the browser's history and without reloading? Or do the equivalent? As far as specifics go, I was developing some basic hash navigation…
user241244
104
votes
7 answers

Prevent user from seeing previously visited secured page after logout

I have the requirement that the end user should not be able to go back to the restricted page after logout/sign out. But currently the end user is able to do that by the browser back button, visiting browser history or even by re-entering the URL in…
raaz
  • 12,410
  • 22
  • 64
  • 81
94
votes
15 answers

Popstate on page's load in Chrome

I am using History API for my web app and have one issue. I do Ajax calls to update some results on the page and use history.pushState() in order to update the browser's location bar without page reload. Then, of course, I use window.popstate in…
spliter
  • 12,321
  • 4
  • 33
  • 36
91
votes
11 answers

Prevent browser scroll on HTML5 History popstate

Is it possible to prevent the default behaviour of scrolling the document when a popstate event occurs? Our site uses jQuery animated scrolling and History.js, and state changes should scroll the user around to different areas of the page whether…
86
votes
2 answers

How do I retrieve if the popstate event comes from back or forward actions with the HTML5 pushstate?

I'm developing a webpage where depending on the next or back actions I do the correspondent animation, the problem comes when using the pushstate. When I receive the event how do I know if the user clicked back or forward history buttons using the…
Davsket
  • 1,248
  • 1
  • 9
  • 14
86
votes
13 answers

Intercepting call to the back button in my AJAX application

I have an AJAX app. A user clicks a button, and the page's display changes. They click the back button, expecting to go to the original state, but instead, they go to the previous page in their browser. How can I intercept and re-assign the back…
Zack Burt
  • 8,257
  • 10
  • 53
  • 81
80
votes
3 answers

What is the trade off between history push and replace?

I use History package to redirect invalid URL to 404 page on my react component. I use .replace instead of .push simply because I don't want the browser to record any invalid url I have visited. Have I missed the point here? And is there a trade-off…
Kris MP
  • 2,305
  • 6
  • 26
  • 38
68
votes
1 answer

how to change url without changing browser history

Until now, I only know that if I want to change URL without reloading the whole page i have to use HTML browser history API. I am using this concept in my website. Let's take example. Let suppose user is on this page …
Paritosh Piplewar
  • 7,982
  • 5
  • 26
  • 41
67
votes
3 answers

How can I delete a window.history state?

Using the HTML5 window.history API, I can control the navigation pretty well on my web app. The app currently has two states: selectDate (1) and enterDetails (2). When the app loads, I replaceState and set a popState…
DanielST
  • 13,783
  • 7
  • 42
  • 65
53
votes
2 answers

Alert, confirm, and prompt not working after using History API on Safari, iOS

After calling history.pushState in Safari on iOS, it's no longer possible to use alert(), confirm() or prompt(), when using the browser back button to change back. Is this an iOS bug? Are there any known workarounds? Simple example to reproduce this…
dan
  • 5,377
  • 13
  • 39
  • 44
51
votes
1 answer

How to detect when history.pushState and history.replaceState are used?

Is there some event I can subscribe to when the history state is modified? How?
BrunoLM
  • 97,872
  • 84
  • 296
  • 452
49
votes
5 answers

Preserve dynamically changed HTML on back button

It's amazing, I constantly see this working in other sites but never in sites that I'm working on. I'm bringing in new content with ajax, I know about history.js and the History API, I do not want to change the URL, just have the browser cache the…
Madd0g
  • 3,841
  • 5
  • 37
  • 59
45
votes
6 answers

How to turn off autocomplete while keep using datalist element in html

I have a input field which shows a list using html5 element. The problem is that with the browser autocomplete also shows the history list (which is the list of previously typed values, that are not included in the ).…
Yousuf Memon
  • 4,638
  • 12
  • 41
  • 57
1
2 3
99 100