HTML: Changing the URL without reloading the page?

后端 未结 1 842
走了就别回头了
走了就别回头了 2020-12-19 18:12

Check out this link:

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

And click on the post and as you can see the URL is changing but without a # or something like

相关标签:
1条回答
  • 2020-12-19 19:03

    pushState:

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

        Pushes the given data onto the session history, with the given title, and, if provided, the given URL...

    the user agent must run the following steps...

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

    Update the current entry to be the this newly added entry...

    0 讨论(0)
提交回复
热议问题