Re:Show HN: Beatbar - Media player that beats in the browser...
by jaip on Sunday April 29, 2012 @07:55AM
(#3905770)
I started with replaceState only, but later I realized there was no specific gain that I was having (other than slightly good looking string without hash). This method also suffers from reload and favicon flashes. If it reliably doesn't log to history (unlike location.replace()), using it could be a good idea. But that also comes with a tradeoff of older browser support issues, which requires using external javascript APIs.
Re:Show HN: Beatbar - Media player that beats in the browser...
by mmahemoff on Sunday April 29, 2012 @08:40AM
(#3905853)
I see. Surprised to learn there were still issues as replaceState() (as with pushState) is purely a transformation in the URL path. There's no reload and no update of the favicon link tag. Makes me wonder if that's a browser bug you saw.
I'd suggest using HTML5 history, specifically replaceState(). It works on all modern browsers. Works on IE10, but not IE9 and below. If you want to support IE, you could fall back to the current location.replace().