BigX_Jazz
BigX_Jazz

Reputation: 103

Url change with animation

I found on a google website, that they realized a url-change without reloading of the whole page. Example: you are on www.googleio.com/first click a button url changes to www.googleio.com/first/second the content "first" disappears with an transition to the left, and the content of "second" appears with another transition. the page isnt reloading. how is this done?

someone told me, that you use the Javascript function 'Header("Location: ../second")', which is aborted after the browser types the url into the adressbar, but before he reloads. the you just let the new content appear with some other javascript. is this true? i couldnt find anything about this. or is there another solution?

thx a lot!

Upvotes: 0

Views: 877

Answers (1)

Nick Mitchinson
Nick Mitchinson

Reputation: 5480

This does not seem like an actual page reload, however an use of AJAX with a pushState router.

What is actually happening is that your browser is making an AJAX call to fetch the next page, and then displaying it when it has received it.

It is using the HTML5 pushState feature to update the URL.

pushState (which you can read more about here) is an HTML5 feature which is similar to the hashes (#) that sites used to use.

Upvotes: 1

Related Questions