Home >Backend Development >PHP Tutorial >javascript - Ask a question about dribbble website
When I click to view the work page, the URL in the browser changes. The page does not jump, but the work details page pops up, and the work can be switched left and right. How can this effect be achieved?
When I click to view the work page, the URL in the browser changes. The page does not jump, but the work details page pops up, and the work can be switched left and right. How can this effect be achieved?
After checking, changing the url is implemented through the Js method window.history.pushState()
. For the API, please refer to the link description. For example, enter in the current window console:
<code>window.history.pushState('q1000', 'Title', '/q/1000');</code>
document.title='question100'
Look at the network request to see how it is implemented. I guess it's asynchronous loading? Or HTTP 2?