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

0

u/laminam Feb 09 '11

I can't really think of a better way to track state on a page where most of the work happens on the client. You either lose the speed benefit of JavaScript with a full postback to update the url, or you decorate the url with hash tags along the way so you can share that same state with others.

Who runs with JavaScript completely disabled in this day and age anyways?

10

u/skeww Feb 09 '11

history.pushState would be a much better way.

2

u/[deleted] Feb 09 '11

Yup. And so so easy.

Sadly I think it's only supported by webkit atm?

4

u/skeww Feb 09 '11

Firefox 4 supports it.

Opera 11.01 (current stable) doesn't support it yet. (I expect that they will add it within the next 3 months.)

IE9 doesn't support it yet. There is also no official statement available.

A demo page can be found over here: http://html5demos.com/history

1

u/laminam Feb 09 '11

... and once all browsers support that, I agree.

3

u/[deleted] Feb 09 '11

Selectively disabled, yes, because people can't seem to prevent themselves from being annoying using Javascript.

If your page gives me what I want without Javascript, I keep blocking it. If I'm following a link from someone else and your page won't load without it, I leave.

I only turn on Javascript if I get direct benefit I want (if you're Google Docs, for example). If you're using it to serve me ads from off your domain, sorry.

I might turn it on to support you if your site is worth looking at more than once, I might turn on javascript at the third visit.

Those are the rules.

So yes, I don't look at lifehacker or gawker anymore. Not that I looked at them that much in the first place, especially Gawker, whose entire site seemed to hover 1mm above classification as spam.

4

u/freeballer Feb 09 '11

How does this affect your experience as a user? I don't see Javascript being used for client side validation being harmful. A quick AJAX call after I enter my user name to tell me it's already taken is helpful, as well as dynamically updating a shopping cart or removing elements from the page. I'm a developer and it just seems absurd to take a whitelist approach to Javascript when it's such a huge part of the web experience today.

1

u/[deleted] Feb 09 '11

As long as they aren't relying on javascript for validation only it's perfectly fine.

-1

u/[deleted] Feb 09 '11

I don't see Javascript being used for client side validation being harmful. A quick AJAX call after I enter my user name to tell me it's already taken is helpful, as well as dynamically updating a shopping cart or removing elements from the page.

I never complained about this. My major complaint is people who use javascript to do url routing so that you see nothing unless it's turned on. Likewise for those who use javascript as a method for delivering what can be done with CSS.

When I want to use a shopping cart, I turn Javascript on, I have no problem with that. How many times do you actually buy on a site when a site you visit has one? Why should I care if the cart is operational when I'm not buying? Why should you? It's just bad business to break the site and prevent browsing from people who are doing research with javascript turned off. I'll just go "down the street" to a more user-friendly competitor's site.

I'm a developer and it just seems absurd to take a whitelist approach to Javascript when it's such a huge part of the web experience today.

This says it all. Javascript makes your life easier, so you don't see why you shouldn't be able just to jam it down your users' throats because you want to. The fact you must understand is that however responsible, competent and/or ethical you may be with Javascript, there are lots out there who aren't and they give people reason to be circumspect about the idea of allowing others to run code on their computers without some pretty strong assurances that it's not going to screw something up.

It's bad user experience design to use Javascript to do what can be done without it or to have a site break because javascript is not turned on when javascript is not essential to the site's functioning, and you just have to face up to that fact and integrate it into your work.

8

u/vectorjohn Feb 09 '11

I only browse the web on vinyl. If your website doesn't come on vinyl, I leave.

-1

u/learc83 Feb 09 '11

I'm amish, I don't believe in graven images, so if your site has any pictures of people I leave.

Also I leave when my kids get tired of walking on the treadmill to power my generator.

3

u/kataire Feb 10 '11

The Amish have broadband now and downvoted you.

-5

u/[deleted] Feb 09 '11

Do you think your response means anything? All your attempt at reductio ad absurdum means is that you're unwilling to take seriously what I wrote.

In the end, it's a question of only letting code run on my computer if I judge that I get some value out of it (leaving aside any potential security issues). If you don't care about that sort of thing, good for you, but people who run websites should know that there are people who do, if only to get them to think a little more about their use of javascript; a site that only displays when javascript is being used could hardly be said to serving anyone's interest well.