Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In HTML5 you can change the URL:</p> <pre><code>window.history.pushState("object or string", "Title", "/new-url"); </code></pre> <p>check <a href="http://spoiledmilk.com/blog/html5-changing-the-browser-url-without-refreshing-page/">http://spoiledmilk.com/blog/html5-changing-the-browser-url-without-refreshing-page/</a></p> <p>docs: <a href="https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history#The_pushState().c2.a0method">https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history#The_pushState().c2.a0method</a></p> <hr> <p><strong>UPDATE</strong></p> <p>An overview of which browser support the new HTML5 history API:</p> <p><a href="http://caniuse.com/#search=pushState">http://caniuse.com/#search=pushState</a> (caniuse.com is worth to bookmark!)</p> <p>there are already frameworks that do the hard work for you and even gracefully fallback to the common hash-tag solution:</p> <p><a href="https://github.com/browserstate/history.js"><strong>History.js</strong></a></p> <blockquote> <p>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.</p> </blockquote> <p><a href="http://documentcloud.github.com/backbone/"><strong>Backbone.js</strong></a></p> <blockquote> <p>Backbone supplies structure to JavaScript-heavy applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface. ... pushState support exists on a purely opt-in basis in Backbone. Older browsers that don't support pushState will continue to use hash-based URL fragments, and if a hash URL is visited by a pushState-capable browser, it will be transparently upgraded to the true URL.</p> </blockquote> <p><a href="http://mootools.net/forge/p/history"><strong>Mootools</strong> (via Plugin)</a></p> <blockquote> <p>MooTools is a compact, modular, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. [...] History Management via popstate or hashchange. Replaces the URL of the page without a reload and falls back to Hashchange on older browsers.</p> </blockquote> <p><a href="http://dojotoolkit.org/reference-guide/dojox/app.html"><strong>dojo toolkit</strong></a></p> <blockquote> <p>Dojo saves you time and scales with your development process, using web standards as its platform. It’s the toolkit experienced developers turn to for building high quality desktop and mobile web applications. [...] dojox.app manage the navigation history through HTML5 pushState standard and delegate it to browser enabled history management.</p> </blockquote> <p>... just to name a few.</p> <hr> <p><strong>(!!) BE AWARE</strong></p> <p>One <strong>important side-effect</strong> when using the <code>pushState</code> (citation from the <a href="http://documentcloud.github.com/backbone/#History">Backbone documentation</a>):</p> <blockquote> <p><strong>Note that using real URLs requires your web server to be able to correctly render those pages</strong>, so back-end changes are required as well. For example, if you have a route of /documents/100, your web server must be able to serve that page, if the browser visits that URL directly. For full search-engine crawlability, it's best to have the server generate the complete HTML for the page ... but if it's a web application, just rendering the same content you would have for the root URL, and filling in the rest with Backbone Views and JavaScript works fine.</p> </blockquote>
    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.
 

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