Reputation: 51
While browsing some popular websites, I noticed that occasionally the url would change to include these characters "#" or "#!". Why is this? From a programmers perspective, what techniques, technologies are they implementing to cause this. Is this a best practice for a certain solution?
Examples: http://twitter.com/#!/ http://www.facebook.com/#/
Upvotes: 5
Views: 3737
Reputation: 375604
Here's a thorough explanation of hash-urls and hash-bang urls: HashURIs by Jeni Tennison.
Upvotes: 7
Reputation: 11441
It is a in-document link. It's called anchor (or fragment) and it is used to link to certain parts within a page and have the browser directly scroll to the right part of the page.
Try this (and read the contents :-)) http://www.w3.org/TR/html4/struct/links.html#h-12.2.3
This browser mechanism has recently been exploited to perform certain advanced javascript/ajax tricks and it's being used extensively by facebook, twitter, etc. When doing so a general convention is to append a ! after the # to distinguish a javascript-bound anchor from a normal one.
Upvotes: 4