Search code examples
ajaxhashchangefragment-identifierhashbangbrowser-state

When using Ajax History and Bookmark, is it always good to use "#!" instead of just "#"?


Facebook is doing Ajax History (Back and Forward button) and Bookmark using #! instead of just # in the URL. Is it always a good idea to do that, because I was thinking that a usual anchor could interfere with the Ajax History mechanism to trigger it into processing a normal anchor.

So, the Ajax History function will only process a hash portion only when it sees #! instead of just #.

And is using ! compatible with major browsers? If Facebook is using !, a guess is that it may be fairly well supported.


Solution

  • See Google's Making AJAX Applications Crawlable for a possible use case (don't know if this is why Facebook used this fragment).