browserstate / history.js

History.js gracefully supports the HTML5 History/State APIs (pushState, replaceState, onPopState) in all browsers. Including continued support for data, titles, replaceState. Supports jQuery, MooTools and Prototype. For HTML5 browsers this means that you can modify the URL directly, without needing to use hashes anymore. For HTML4 browsers it will revert back to using the old onhashchange functionality.
http://browserstate.github.com/history.js/demo/
Other
10.74k stars 1.35k forks source link

html4Mode option #289

Open smarques opened 11 years ago

smarques commented 11 years ago

I can not get the html4Mode option to work for me. I am using the ajaxify script (https://github.com/browserstate/ajaxify) on a very simple two page app. Everything works fine, but if I want to force the html4 fallback for testing purposes nothing changes, it seems history ignores the options and continues to use html5 push state urls.

I just changed the ajaxify script adding (on DOM ready):
History.options.html4Mode = true;

(I am including the v1.8b1 jquery html4+5 bundle script )

lionelB commented 11 years ago

I had the same problem Does I need to create History.options before I include History.js script ?

thanks you

2is10 commented 11 years ago

Looks like you need to define most options before including history.js. For example:

<script>window.History = {options: {html4Mode: true}};</script>
<script src="history.js"></script>