开发者

How does facebook rewrite URLs in Chrome & Firefox?

Facebook is almost completely AJAX, and I'm aware in older browsers and IE9, Facebook uses the hash tag to rewrite unique UR开发者_开发问答Ls, like...

http://www.facebook.com/home.php#!/?sk=welcome

http://www.facebook.com/home.php#!/?abc123

However, in Google Chrome and Firefox 4, Facebook is using something different, and rewriting to:

http://www.facebook.com/?sk=inbox

http://www.facebook.com/home.php?sk=bd

All completely in AJAX, modifying the URL and not even just whats after the hash tag (which never gets sent to the server.)


It is using the new HTML5 history API, in particular the history.pushState method.

It allows to change the path, query or fragment part of an URL.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜