Julien Grenier
Julien Grenier

Reputation: 3394

How to change chrome to behave like firefox when using the history.pushState /popstate

I am using ajax to populate parts of my html pages (when the page load or based on user click).

When I press the back and forward button using Firefox (4) or Safari (5.0.5) everything is fine. But when I press them using chrome I only get the last ajax result (if I press back) instead of the last page in the history.

I tried working with the history.pushState and popstate event but The popstate event is fired when the page load and not when I press the back button which is counter intuitive.

Upvotes: 2

Views: 1069

Answers (1)

balupton
balupton

Reputation: 48650

Use History.js it normalizes the behavior between browsers and optionally provides a hash fallback for html4 browsers.

Upvotes: 1

Related Questions