This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10876|Reply: 3

[JavaScript] history.pushState implements the browser page without refreshing the modified URL link

[Copy link]
Posted on 6/20/2019 10:17:16 AM | | |
1. stateObject - stateObject is a JavaScript object that can pass stateObject content to a new page through the pushState method.

2. Title - Almost no browser supports this parameter, but it is safer to pass an empty string.

3. Address (URL) - the address of the new history entry (optional, if not specified, the current URL of the document); The browser does not load the address after calling the pushState() method; The incoming URL should be homologous to the current URL, otherwise, pushState() throws an exception.








Previous:Share an awesome exe to record GIFs
Next:Alibaba Cloud load balancing SLB's HTTP redirect to HTTPS pit
Posted on 6/20/2019 10:55:31 AM |
Many front-end frameworks now use this technique, click on the menu, the URL changes, and there are no new network requests
 Landlord| Posted on 6/20/2019 11:24:05 AM |
Small slag Posted on 2019-6-20 10:55
Nowadays, many front-end frameworks use this technique, click on the menu, the URL changes, and there are no new network requests...

Is that the new page content already in the cache?
Posted on 6/20/2019 11:56:00 AM |
Summer Posted on 2019-6-20 11:24
Is that the new page content already in the cache?

No, it is the first request, all the key content of the page has been downloaded, and then JS also has the concept of routing, giving you different content according to different URLs.
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com