Why exclamation is used in URLs? [duplicate]

假装没事ソ 提交于 2020-01-31 09:38:53

问题


Possible Duplicate:
What's the shebang (#!) in Facebook and new Twitter URLs for?

Hi

I was just wondering what is the use of "!" in urls like this

http://www.facebook.com/profile.php?id=xxxxxxxx&v=wall#!/profile.php?id=yyyyyy&v=wall

I know Facebook uses #(hash) for changing the query string parameters with JavaScript but what is the meaning of exclamation (!), why it is used after # ? We can even work with # only to change the querystring params. Is there any benefit of using ! ? or any other thing is there which I am missing ?


回答1:


It's because it is an AJAX crawlable notation for URLS, an effort driven by Google to define a convention allowing Web 2.0 websites to be indexed by search engines.

And of course check the perfectly valid answer for What's the Shebang in the new Facebook and Twitter URLs?




回答2:


It's a convention used for AJAX requests, one that lets google crawl that ajax content. There are some other major examples of this, twitter for example.

In Chrome (and other browsers as they support it) you won't see those URLs, since facebook is also using some HTML5 history features to change the URL in the address bar/browser history.



来源:https://stackoverflow.com/questions/4376719/why-exclamation-is-used-in-urls

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!