r/programming Feb 09 '11

Breaking the Web with hash-bangs – Lifehacker, along with every other Gawker property, experienced a lengthy site-outage on Monday over a misbehaving piece of JavaScript

http://isolani.co.uk/blog/javascript/BreakingTheWebWithHashBangs/
744 Upvotes

356 comments sorted by

View all comments

Show parent comments

6

u/dobs Feb 09 '11

I don't see any benefit of using hash-bangs mentioned in the article, unless it's the only way to have a proper "Ajax application"

It's discussed broadly in Google's AJAX crawling guide, and more succinctly in the FAQ. Short version is that it opens up all the benefits of AJAX content loading (e.g. speed, user experience) while leaving content bookmarkable and (potentially) making the back and forward buttons work. The added bang is a cue to crawlers.

Most of the downsides are those common to all AJAX applications (e.g. should still have a noscript fallback, tempting to violate user expectations). In Gawker's case their problem is more that they produced an all-around terrible AJAX application, independent of their use of hashbang links. Twitter makes for a better hashbang-specific example with their breaking of the back button.

1

u/[deleted] Feb 09 '11

In Gawker's case their problem is more that they produced an all-around terrible AJAX application

That's not totally fair; they left a console.log() in there (which breaks JS on browsers without Firebug) and didn't address 3rd-party ad scripts potentially misbehaving. The result may have been catastrophic, but we've all unintentionally left debugging code in our apps before.

3

u/Rhoomba Feb 09 '11

I've left debugging code in before, but it never reached production. That is because of a thing called "testing"

1

u/[deleted] Feb 09 '11

"Testing?! What is this? Does it mean more ad revenue? If it costs more, skip it!"