Hash(#) 在 URL 中的使用 [英] Usage of Hash(#) in URL
问题描述
我想知道除了作为 URL 中的锚点之外,是否还有其他用途的哈希.我在这里读到了它获取完整的 url,包括哈希后的查询字符串 .客户端的状态信息是什么?请帮忙.
I was wondering is there any use of hash other than as an anchor in URL. I read about it here getting the full url including query string after hash . What is state information for the client? Please help.
推荐答案
散列也可用于单页应用程序,因此不是使用它来导航到页面中的某个点,而是使用散列作为导航的手段从一页到另一页.这样做的好处是不需要刷新页面.
The hash can be used also for single page applications, so instead of using it to navigate to a point in a page you use the hash as a means for navigated from page to page. The advantage of this is that it does not require a page refresh.
还有一种叫做 hashbanging 的方法,用于单页应用程序,用于帮助 ajax 应用程序更可索引.
There is also a method called hashbanging which is used for single page applications and is used for helping ajax applications more indexible.
有几篇关于这个主题的好文章
There are a few good articles on the subject
- https://github.com/browserstate/history.js/wiki/智能状态处理
- http://danwebb.net/2011/5/28/it-is-about-the-hashbangs
- https://developers.google.com/webmasters/ajax-crawling/
这篇关于Hash(#) 在 URL 中的使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!