News for hackers. Stuff that matters.
Re:Like.fm is how Apple Ping should work by akamaka on Saturday September 04, 2010 @07:22PM (#1663641)
I love how the music player in the bottom right corner of like.fm stays open as you navigate between different pages.

Does anyone know how they did this?

Edit: To clarify my question, this is probably done with AJAX, but like.fm also updates the browser URL bar, without using a hash anchor fragment like gmail. Any idea how that's done?

Re:Like.fm is how Apple Ping should work by chrischen on Saturday September 04, 2010 @09:35PM (#1663821)
You're either using Chrome, Safari, or the Firefox 4 beta. This is the HTML5 history management API doing it's magic. If you want my uncompressed javascript to take a look let me know [email protected] (it's kinda messy). If you use an older browser that doesn't support HTML5 history management then it goes back to the hash thingy.
Re:Like.fm is how Apple Ping should work by bmelton on Saturday September 04, 2010 @08:34PM (#1663735)
Without looking, one easy way to do it would be to AJAX the entire site, such that when you click on a link, it loads the entire content panel dynamically, while keeping the player div active. Basically, reload everything on the page except the player, but never actually take the user to another page.
Re:Like.fm is how Apple Ping should work by akamaka on Saturday September 04, 2010 @09:13PM (#1663788)
Right. The next step is to change the URL bar in the browser with each new page, so that history, bookmarking, and link-sharing work properly.

I've seen this done using anchor fragments (in other words, only changing the part of the URL after the hash symbol). That's how gmail does it (gmail.com/foo#inbox).

This site seems to have some other method that doesn't require the hash. I've never seen this on any website, so I would really love to know how its done!!

Re:Like.fm is how Apple Ping should work by bmelton on Tuesday September 07, 2010 @12:54PM (#1669361)
(Sorry to respond to such an old item, but I just got the chance to look)

I don't know what browser you're using, or if they're doing something to mask the URL that they're using, but in IE7, the url IS updated on anchor fragments. The links themselves point to something canonical looking (e.g., like.fm/user/home), but when you actually click on it, the url you end up at is clearly implemented using anchor fragments (i.e., like.fm/#/user/home).

For what it's worth, there's a bug in it on IE7, such that if I keep clicking the same link (even after I get there), it malforms, and keeps malforming with each click (though the pages still seem to work) -- like.fm/user/home#r//user//user//user//user/home