0

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

I see twitter's url is this type: twitter/#!/username

I known that twitter's front page uses ruby on rails framework, but "#!" is not the suggest type in RoR restful routes. So why twitter uses this strange url type? Is there any special reason?

Community
  • 1
  • 1
alucardpj
  • 3
  • 2
  • 1
    Take a look at this question: http://stackoverflow.com/questions/3009380/whats-the-shebang-hashbang-in-facebook-and-new-twitter-urls-for – Jan Dec 02 '11 at 05:55

2 Answers2

1

It's a hashbang URL. In the days before HTML5 JavaScript URL rewriting, there was no way to rewrite stuff in the address bar, except for the hash symbol. Natively, the hash symbol in a link points to the id of some element on the webpage. This is overridden in JavaScript to perform other actions.

It's really weird that Twitter is using it, especially since there are libraries that failover to using hashbang but use the new history.pushState function when it's available.

Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411
1

Twitter uses AJAX a lot on their pages. You almost never see a reloa of the whole page. By using those anchor links they avoid reloading the page but still give you a chance to store the current state of the page as a favorite or use the back button of your browser

klaustopher
  • 6,702
  • 1
  • 22
  • 25