Wednesday, September 12, 2012

HTML5 - Change the URL without reloading the page

With HTML5 (compliant browsers), it is now possible to alter the URL in the address bar without reloading the page.
 This can be quite handy in many situations...
to try it quickly, run this script after the page is loaded:

 window.history.pushState("","", "heyIJustChangedMyUrlWithoutPosting");

To learn more, refer to:

A) The original article ;

 B) StackOverflow Post 1 and Post 2 ;

C) The Official W3C documentation .


 HTML5 is revealing its beauty every day a bit more!

2 comments: