Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Browser support</strong></p> <p><a href="http://caniuse.com/#feat=history" rel="nofollow">Forget it</a>. Not even IE 9 supports <code>history.pushState</code>. Mobile browsers not very safe either. But there is a library (see below) that makes this incompatibility completely transparent to the developer. </p> <p><strong>Library</strong></p> <p>Well, in pure HTML 5 environments, the history api is pretty straightforward. For others, the <a href="https://github.com/balupton/History.js/" rel="nofollow">history.js</a> library has gotten quite some attention, plus it offers an automated fallback to the old hash-writing</p> <p><strong>On Small Websites</strong></p> <p>Well, you better have your JavaScript and your potential States organised, then. But if so, I see no problem.</p> <p><strong>History &amp; jQuery &amp; plugins</strong></p> <p>I have used the two together in a couple of projects now. I have not yet found any problem with using jQuery and jQuery Plugins, except for - of course - the typical issues associated with Injected HTML (i.e. event handlers must be rebound; <code>$(document).ready()</code> might or might not work in some environments, etc).</p> <p><strong>Hashes vs. history.pushState</strong></p> <p>The Hash-Notation has been used as a workaround (or nowadays, fallback). It becomes unnecessary when using history.pushState. </p> <p>What I have found to be the major difference is, that the URL in the address bar is always directly understandable by the server, especially for bookmarking or link-sharing purposes. If you had <a href="http://example.org/#/my/fancy/site" rel="nofollow">http://example.org/#/my/fancy/site</a>, then your index page would have to parse the hash (via javascript, as you can't access the hash server-side), and then inject/redirect to <code>my/fancy/site</code>.</p> <p>However, if using using history.pushState, the Browser's address bar shows <a href="http://example.org/my/fancy/site" rel="nofollow">http://example.org/my/fancy/site</a> - which is directly routable.</p> <p>(and, imagine spelling out a hash, or hash-bang URL to someone via phone!)</p> <p>Hope that clarifies some or your doubts with history! I can strongly recommend History.js as library a of choice.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload