views:

99

answers:

0

As the majority of you know AJAX works poorly with fixed URLs and all major sites now use the # to split the AJAX part of the URL. I will also do that but am trying to achieve the prettier, less obtuse and fastest way of doing it.

Edit: So far I've analysed Facebook way of doing it (last night I've done it poorly) and silky pointed me on the right direction. Thank you. I shall not write questions at 2AM again!

You go to an image page, say:
site.com/photo.php?pid=3518179&id=640221256

As you navigate the other images facebook appends a # to your URL:
site.com/photo.php?pid=3518179&id=640221256#/photo.php?pid=3518181&id=640221256

If you grab that URL and paste it into another window, Facebook's JavaScript will instantly redirect you to the part of the URL that comes after the #.

Works like a charm but has these disadvantages:

  • two hits on the server
  • not at all beautiful
  • javascript is used for redirection so it is not SEO friendly

Anyone came up with different (better) ways of doing it?