Facebook 和新的 Twitter URL 中的 shebang/hashbang (#!) 是做什么用的? [英] What's the shebang/hashbang (#!) in Facebook and new Twitter URLs for?

查看:25
本文介绍了Facebook 和新的 Twitter URL 中的 shebang/hashbang (#!) 是做什么用的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚注意到我们习惯的冗长、复杂的 Facebook 网址现在看起来像这样:

I've just noticed that the long, convoluted Facebook URLs that we're used to now look like this:

http://www.facebook.com/example.profile#!/pages/Another-Page/123456789012345

据我所知,今年早些时候,它只是一个普通的类似 URL 片段的字符串(以 # 开头),没有感叹号.但现在它是一个 shebang 或 hashbang (#!),我以前只在 shell 脚本和 Perl 脚本中看到过.

As far as I can recall, earlier this year it was just a normal URL-fragment-like string (starting with #), without the exclamation mark. But now it's a shebang or hashbang (#!), which I've previously only seen in shell scripts and Perl scripts.

新的 Twitter URL 现在还具有 #! 符号.例如,Twitter 个人资料 URL 现在看起来像这样:

The new Twitter URLs now also feature the #! symbols. A Twitter profile URL, for example, now looks like this:

http://twitter.com/#!/BoltClock

#! 现在是否在 URL 中扮演了一些特殊的角色,比如某个 Ajax 框架或其他东西,因为新的 Facebook 和 Twitter 界面现在主要是 Ajax 化的?
在我的 URL 中使用它会对我的 Web 应用程序有任何好处吗?

Does #! now play some special role in URLs, like for a certain Ajax framework or something since the new Facebook and Twitter interfaces are now largely Ajaxified?
Would using this in my URLs benefit my Web application in any way?

推荐答案

这个技巧是现已弃用.

过去告诉 Google 如何将页面编入索引.

This used to tell Google how to index the page.

https://developers.google.com/webmasters/ajax-crawling/

该技术已被使用与 HTML5 一起引入的 JavaScript History API 的能力所取代.对于像 www.example.com/ajax.html#!key=value 这样的 URL,Google 会检查 URL www.example.com/ajax.html?_escaped_fragment_=key=value 获取非 AJAX 版本的内容.

This technique has mostly been supplanted by the ability to use the JavaScript History API that was introduced alongside HTML5. For a URL like www.example.com/ajax.html#!key=value, Google will check the URL www.example.com/ajax.html?_escaped_fragment_=key=value to fetch a non-AJAX version of the contents.

这篇关于Facebook 和新的 Twitter URL 中的 shebang/hashbang (#!) 是做什么用的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆