问题描述
我们了解哈希是AJAX搜索,但感叹号?任何人都知道?
We understand the hash is for AJAX searches, but the exclamation mark? Anyone know?
此外,行动属性的搜索表单指向/搜索,但是当你进行搜索,哈希感叹号出现在URL中。难道他们只是从/搜索,以/#!/搜索?
Also, the "action" attribute for their search form points to "/search," but when you conduct a search, the hash exclamation mark appears in the URL. Are they simply redirecting from "/search" to "/#!/search"?
注意:的q的第二部分仍然没有答案:那就是,他们是否把用户重定向从/搜索,以/#/搜索!,还是他们向用户发送/搜索,并使用JS在页面上重写的网址是什么? - Crashalot 1月26日在23:51
Note: the second part of the q remains unanswered: That is, are they redirecting the user from "/search" to "/#!/search", or do they send the user to "/search" and use JS on the page to rewrite the URL? – Crashalot Jan 26 at 23:51
谢谢!
推荐答案
要回答的第二部分则:!这是你重定向到/#/搜索
To answer the second part then: It is redirecting you to /#!/search.
如果你看一下响应头去 http://twitter.com/britishdev 时(插塞)将返回一个302(临时重定向)与Location头设置为Location: http://twitter.com/#!/britishdev
If you look at the response headers when going to http://twitter.com/britishdev (plug plug) you are returned a 302 (temporary redirect) with the Location header set as "Location: http://twitter.com/#!/britishdev"
是JavaScript的,然后拉你所有的细节,在目标页面上,但无论是在那里你会被重定向到。
Yes JavaScript is then pulling all your detail in on the destination page but regardless that is where you are redirected to.
这篇关于为什么Twitter的使用哈希和感叹号的网址,以及它们如何重写搜索的网址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!