Change browser URL and page content without reload and without using fragments
Asked Answered
Y

2

5

I'm well aware of the technique of using URL fragments to track state on an AJAX powered webpage, but lately I've noticed a lot of sites that are doing something similar but without fragments.

The picture viewer in the latest version of Facebook for example operates this way. The left and right navigation buttons are simple links with no fragments that when clicked change the browsers URL without doing a full page load.

Another example is GitHub's repository browser, each of the files/folders is a simple link that changes the page state and browser URL without reloading or using page fragments.

Can anyone explain, or point me to an explanation of how this works? I've done some searching, but there is so much content on using fragments that I haven't been able to find anything.

Yvonneyvonner answered 12/2, 2011 at 17:50 Comment(1)
possible duplicate of How to do awesome refreshless page changes like GitHubParmer
S
4

I believe this is due to the new History pushState HTML5 feature

Spacetime answered 12/2, 2011 at 17:59 Comment(2)
Awesome, thanks! Facebook does indeed degrade to fragments and github degrades to full page refreshes on "downlevel" IE8.Yvonneyvonner
Yep no problem. Yeah eventually when HTML5 support is more widespread this will be quite a useful feature thoughSpacetime
M
1

They are using new HTML5 History API. I think this is what you want. check the menu items in this page http://tinywall.info/demos/html5-history-api/menu1.php

The tutorial to implement is right here : http://t.co/M4RvnvoQ

Mogilev answered 22/2, 2012 at 13:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.