HTML: changing a URL without reloading the page?

Check out this link:

http://google.blogspot.com/view/timeslide

And click on the message, and as you can see, the URL changes, but without # or something like that, it changes as the page normally loads, but the content changes the way it is built using AJAX.

This happens with Chrome 10 with the latest stable version, but for Firefox 3.6 it uses the old hash method :)

How is this possible, is this a new HTML5 feature or what?

+4
source share
1 answer

pushState :

window . history . pushState(data, title [, url ] )

Pops data into the session history with the specified header and, if provided, the given URL ...

the user agent must complete the following steps ...

Add a record of the state object to the session history, after the current record , with the cloned data as the state object, this header as the name, and if the third argument is present, the absolute URL that was found earlier in this algorithm as the URL of the record.

Update the current record as a newly added record ...

+11
source

Source: https://habr.com/ru/post/1346380/


All Articles