Flickr’s photo page Ajax trick

Flickr recently started previewing their new photo pages. They’re quite nice but it does something that’s been driving me mad and I can’t work out how it’s doing it. It only happens in Google Chrome 5 and I’ve only seen it in a few places.

Take a look at this screen capture of Flickr’s new lightbox view. Note how the URL updates each time I click through to a new view. Nothing surprising there until you realise it’s not doing a full refresh of the page and is actually an Ajax call back to the server. (You may want to hit the full screen button, bottom right.)

Contrast that with what happens in Firefox – it’s still doing Ajax calls to make flicking between photos quick but the URL changes after the fragment

This technique is pretty common – Facebook have been using it for a couple of years and we even use it to give tabbed pages history on our site. It’s necessary because JavaScript isn’t allowed to set the full page URL without a page refresh, or at least that’s what I thought!

Google Maps has been doing the same as Flickr for a couple of months but I’ve still no idea how! Anyone care to read the Chromium source code or dig around Flickr’s JavaScript to see if there’s something different?

Update: also works in Safari, thanks Ross.