如何在不刷新页面的情况下更改URL?

时间:2020-09-22 14:50:42

标签: javascript html

诸如https://featurepoints.com之类的某些网站正在使用一种技术,其中用户无需任何刷新即可打开新页面,URL将被更改,但是没有刷新或使用ajax。 他们使用什么技术?是pushState吗?

1 个答案:

答案 0 :(得分:3)

我认为您可能正在寻找history.pushState

MSBUILD : error MSB1009: Project file does not exist. 
- Switch: '..\..\src\httpapi\httpapi.csproj'

使用您的https://featurepoints.com/

示例
history.pushState([data], [title], [URL]);

来源和更多详细信息https://css-tricks.com/using-the-html5-history-api/