browser-history

Statechange is firing whenever i do a push-state

∥☆過路亽.° 提交于 2019-12-18 04:34:22
问题 I am using history.js to handle back button. In history.js statechange is firing whenever i do a pushstate. Why? 回答1: According to this discussion on github, it's expected behaviour of history.js This pull request claims to have modified history.js to be more inline with W3C Specs. 回答2: Wanted to add, yes this is the expected behaviour of History.js. At the same time there are more discussions that critize this behaviour as it is not the W3C standard and does create some confusion. In short,

React Router browserHistory not working as expected

帅比萌擦擦* 提交于 2019-12-18 02:41:56
问题 As a User i want to access content via going direkt on an deep url Situation On the Main Page i have a link to "about" page. clicking on the the Content changes as expected. The Page gets loaded and the url changes to localhost:8080/about. If I now refresh the Page i get the error: Cannot GET /about I wonder if this is the normal behavior or did I miss something out? Routes: var React = require('react'); var ReactRouter = require('react-router'); var Router = ReactRouter.Router; var Route =

How to access Google Chrome browser history programmatically on local machine

爱⌒轻易说出口 提交于 2019-12-17 17:31:52
问题 I want to write a simple program which shows my internet activity over a period of time (which site I visited, how many times and so on). I mostly use Google Chrome browser. I found out Chrome stores browser history at this location (please correct me if I'm wrong) C:\Documents and Settings\<username>\Local Settings\Application Data\Google\Chrome\User Data\Default How can I open the history files? They don't have any file extension. I could not open using notepad, SQLite browser. How do I

Can you use hash navigation without affecting history?

你说的曾经没有我的故事 提交于 2019-12-17 17:24:30
问题 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 along the lines of: //hash nav -- works with js-tabs var getHash = window.location.hash; var hashPref = "tab-"; function useHash(newHash) { //set js-tab according to hash newHash = newHash.replace('#'+hashPref, ''); $("#tabs li a[href='"+ newHash

Is My Page Being Loaded from the Browser Cache?

落花浮王杯 提交于 2019-12-17 16:27:36
问题 I have a "new items" badge on a page that I want to update immediately the page is loaded from the cache (i.e. when hitting "Back" or "Forward" to return to this page). What is the best way to accomplish this? The setup is pretty simple. The layout for the app looks for new items every 8 seconds, and updates the badge + list of items accordingly. $(function() { setInterval( App.pollForNewItems, 8000 ); }); When someone navigates away from this page to look at the details of an item, a lot can

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

只谈情不闲聊 提交于 2019-12-17 09:37:53
问题 This question already has answers here : How to get notified about changes of the history via history.pushState? (9 answers) Closed 4 years ago . Is there some event I can subscribe to when the history state is modified? How? 回答1: The onpopstate event should be fired when the history changes, you can bind to it in your code like this: window.onpopstate = function (event) { // do stuff here } This event may also be fired when the page loads, you can determine whether the event was fired from a

JS - window.history - Delete a state

风流意气都作罢 提交于 2019-12-17 08:25:57
问题 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 listener: history.replaceState({stage:"selectDate",...},...); window.onpopstate = function(event) { that.toStage(event.state.stage); }; When a date is selected and the app moves to stage 2 I push state 2 onto the stack: history.pushState({stage:"enterDetails",...},...); This

JS - window.history - Delete a state

浪尽此生 提交于 2019-12-17 08:24:29
问题 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 listener: history.replaceState({stage:"selectDate",...},...); window.onpopstate = function(event) { that.toStage(event.state.stage); }; When a date is selected and the app moves to stage 2 I push state 2 onto the stack: history.pushState({stage:"enterDetails",...},...); This

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

孤者浪人 提交于 2019-12-17 07:15:15
问题 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 Pushstate API?, or do I have to implement something myself? 回答1: You must implement it yourself which is quite easy. When invoking pushState give the data object a unique incrementing id (uid). When onpopstate handler is invoked; check the state uid

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

女生的网名这么多〃 提交于 2019-12-17 07:15:05
问题 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 Pushstate API?, or do I have to implement something myself? 回答1: You must implement it yourself which is quite easy. When invoking pushState give the data object a unique incrementing id (uid). When onpopstate handler is invoked; check the state uid