Questions tagged [history.js]

A JavaScript library implementing the HTML5 History APIs for backwards compatibility with legacy browsers.

Source code and documentation of History.js is available on GitHub: https://github.com/browserstate/history.js/

494 questions
89
votes
13 answers

React history.push() is updating url but not navigating to it in browser

I've read many things about react-router v4 and the npm history library to this point, but none seems to be helping me. My code is functioning as expected up to the point when it should navigate and do a simple redirect when the url is changed using…
John
  • 1,075
  • 1
  • 7
  • 13
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
39
votes
12 answers

React require("history").createBrowserHistory` instead of `require("history/createBrowserHistory")

So basically i am having a problem in using the history library in react. Is it because of the latest version should i try to downgrade the history version but as the error states that Support for the latter will be removed in the next major…
Nick Bb
  • 601
  • 1
  • 8
  • 18
28
votes
6 answers

history.pushState does not trigger 'popstate' event

Why window.addEventListener('popstate', () => alert('pop')); window.history.pushState(null, '', '/foo'); does not alert pop ? NB: Testing on latest chrome -- According to MDN: A popstate event is dispatched to the window every time the active…
abernier
  • 27,030
  • 20
  • 83
  • 114
24
votes
1 answer

How do I actually use history.js on my site

I've read all the posts about history.js on stackoverflow including, this, this and this and at looked the source code but as a newcomer to javascript/jquery I'm having trouble figuring out how to actually implement to have html 5 history support…
pappley
  • 479
  • 1
  • 4
  • 12
22
votes
2 answers

Can't understand History.js, need it simplified?

I'm fairly new to programming, and I'm making an AJAX site with the help of jQuery. I've looked around a fair bit for an AJAX history handler, and figured that History.js seems to be the best/most up-to-date. My menu buttons each have their own…
Peter
  • 221
  • 1
  • 2
  • 3
18
votes
2 answers

jquery.history.js VS jquery-hashchange

See http://balupton.github.io/jquery-history/demo/ I was attracted with jquery.history.js mean while I found http://benalman.com/code/projects/jquery-hashchange/examples/document_domain/ I think the second one is just based on JQuery. I mean it…
Kuttan Sujith
  • 7,889
  • 18
  • 64
  • 95
17
votes
4 answers

HTML5 history disabling forward button

I am writing a single page javascript application using the HTML5 History API. The application loads content via Ajax and internally maintains state information on the foreground screen using a screen stack. I want to enable navigation with the back…
dmck
  • 7,801
  • 7
  • 43
  • 79
15
votes
3 answers

Statechange is firing whenever i do a push-state

I am using history.js to handle back button. In history.js statechange is firing whenever i do a pushstate. Why?
aWebDeveloper
  • 36,687
  • 39
  • 170
  • 242
15
votes
2 answers

Implementation of History.js

I am trying to implement History.js for my ajax site so that I can use forward and back buttons and even bookmarks. However the example @ https://github.com/browserstate/History.js/ has me a bit confused as into how to implement it. Does anyone have…
Kern Elliott
  • 1,659
  • 5
  • 41
  • 65
15
votes
1 answer

Html5 History Api - pushState from a domain to a subdomain

I have a website as the landing and information page to a web portal type of application. I need the link that goes to the portal to set off an animation that beautifully transitions to the portal view (navigation slides out, new navigation slides…
parliament
  • 21,544
  • 38
  • 148
  • 238
15
votes
2 answers

JQuery & history.js back button not working

I'm using history.JS (latest) with Jquery (latest) to load and replace just a portion of a website, this is all working, currently I'm only trying to get it working in modern browsers so I'm not fiddling with the hash changes. Everything seems to…
Al_
  • 2,479
  • 7
  • 29
  • 43
14
votes
2 answers

Difference in history implementation by backbone.js, davis.js and history.js

All these 3 libraries allow to manipulate history object. OK, backbone does a lot of more but let consider only it history…
Wojciech Bednarski
  • 6,033
  • 9
  • 49
  • 73
13
votes
1 answer

Restoring content when clicking back button with History.js

I've implemented History.js on a local test application. Everything seems to work, however if I press the back button in the browser, the previous content does not get restored. Do I actually have to load the content manually again (i.e. make…
user990827
  • 553
  • 1
  • 5
  • 10
13
votes
1 answer

jQuery History.js:about statechange event trigger due to browser forward and backward button

I just integrated History.js in my jquery Ajax application but I could not find a way how to differentiate statechange event due to History.pushState in my own code and due to user clicking on Browser back and forward button (in both cases the event…
ace
  • 11,526
  • 39
  • 113
  • 193
1
2 3
32 33