Why exclamation is used in URLs? [duplicate]

2019-03-27 10:20发布

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 ?

标签: url
2条回答
3楼-- · 2019-03-27 10:51

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.

查看更多
登录 后发表回答