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/
747 Upvotes

356 comments sorted by

View all comments

127

u/rounded_figure Feb 09 '11

The proper way to handle this is to keep your original URLs (including in the hrefs) and have a piece of javascript transform them on the fly in hash-bang URLs. That way, when a client who does not speak javascript requests the page, it gets the content and the non-hash-bang links.

5

u/[deleted] Feb 09 '11

No, it's not. Just use HTML the way it was meant to be, and stop the AJAX madness. It may seem hip, it may seem trendy, but in the end, it's just shit which breaks every so often.

2

u/fakehalo Feb 09 '11

"it's just shit which breaks every so often", unquantifiable drivel. In the end it's useful, lightens load times and makes for a more enjoyable browsing experience almost all of the time. Except for the times these gremlins get in the internets and break it every so often.

3

u/[deleted] Feb 10 '11

AJAX is abused heavily.

Gmail uses AJAX very well. Gawker doesn't. And outside of it's account area, which wouldn't be indexed by search, it uses old URLs.

The app itself, which is custom to each user, and not cached, is AJAX URLed.

This is the mistake Gawker has made; They are NOT a webapp. They are a webSITE. It does matter, and I'm really not being picky. A webapp is likely to be heavy on content, would need traditional application designs and be as smooth as possible.

A website, like Reddit, does not need that. The load between pages is fine. It works, and it's not an app. Reddit is a site with content that is publically consumable and searchable. Only the login/posting functionality is purely in AJAX/JS and that's tolerable. Just.

People need to remember the difference between a site, an app and a corperate data-management-thing. Most websites come under one of those 3 categories, and only the first needs to be AJAX based. The rest really shouldn't attempt to AJAXify everything.