GitHub如何更改URL而不是重新加载? [英] How does GitHub change the URL but not the reload?
本文介绍了GitHub如何更改URL而不是重新加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道所有这些,我只是想知道他们是如何做到的修改了网址。你可以用JavaScript来设置URL吗?如果是这样的话,这对于为基于JavaScript的网站的一部分添加书签可能非常有用。 (在一个页面中的几页,用JavaScript之间移动)
谢谢。
>它使用历史操纵API 中的新推/弹出状态功能。
Hey, I have noticed that when browsing a GitHub repository it uses AJAX to load each folder / file.
I understand all this, I was just wondering how they altered the URL. Can you get and set the URL with JavaScript? If so it could be very useful for bookmarking a section of a JavaScript based website. ( a few pages within one, moved between with JavaScript )
Thanks.
解决方案
It uses the new push/pop state functions in the history manipulation API.
这篇关于GitHub如何更改URL而不是重新加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文