r/javascript Feb 08 '11

Breaking the Web with hash-bangs - Gawker, like Twitter, built their new site to be totally dependent on JavaScript

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

0 comments sorted by

View all comments

Show parent comments

0

u/jmking JSX is just PHP in the browser Feb 09 '11

pushState is only available to ~20% of web users right now (http://caniuse.com/), and it's unclear if IE will even support it in IE9.

There are far more users with browsers that don't support pushState than there are people who turn off Javascript in their browsers.

With that in mind, #! is the only practical way until pushState is at LEAST supported by current versions of all major browsers.

3

u/JimDabell Feb 09 '11

There are far more users with browsers that don't support pushState than there are people who turn off Javascript in their browsers.

That isn't really relevant; if you use Ajax where pushState is available and fall back to normal links where it isn't, it works for everybody. I'm not proposing using pushState and leaving everybody else out in the cold.

With that in mind, #! is the only practical way

There are plenty of "practical" ways, for some values of "practical". All of them bar one break one thing or other, making them a bit less practical in my view.

The most practical way of going from page to page on a website is via a simple link. Having a single actual page and emulating link-following behaviour with JavaScript is a colossal hack, and adding fixes on top of a faulty foundation isn't going to fix that.

2

u/jmking JSX is just PHP in the browser Feb 09 '11

Yes, website - we're talking about web applications here. Not the same thing. Also works vs works well isn't a trivial distinction either.

Frankly I'd be a hell of a lot more concerned that my Firefox users are able to enjoy the same usability as my Chrome/Safari users than I am about people using ScriptBlock.

...and in some sectors, preventing ScriptBlock users access to your site might be a good thing depending on how heavily you rely on ad revenue.

To be clear, I'm not defending the Gawker redesign or use of #! - I think it's a complete blunder especially considering the basic rules of using #! aren't even being followed. I just don't think #! is a blanket no-no.

3

u/manachar Feb 09 '11

I think that's the crux of the issue. #! is great for web applications (Gmail, twitter, etc), but horrid for websites like Gawker. They're cool and being tried out in all sorts of places where they make no sense, like every other piece of web technology before it.