Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

JavaScript -off Unfriendly, And Proud About It

DZone's Guide to

JavaScript -off Unfriendly, And Proud About It

· Web Dev Zone ·
Free Resource

Classify programming languages: Build a model that predicts a code's programming language based on its text.  Content provided by IBM Developer. 

Your site should work even with JavaScript turned off, they say. I strongly disagree. First, it is a lot of effort to make a function-heavy site work without JavaScript . You’ve build the thing to work with ajax, cool controls and lots of dialogs. And you should build an entirely new version for those 2 percent that don’t have JavaScript ? The effort just isn’t worth it. Not even for facebook, youtube and twitter – neither of them works without JavaScript .

So, when I develop a web app that fails to work properly without JavaScript (like welshare), I’m very much aware of that, and it’s done on purpose – to save unnecessary effort, and not to provide a crappy version of the UI. Of course, completely ignoring the fact that javascript may be turned off would be too one-sided. So:

  • make the basic home page and the signup page be workable without javascript. Some users (like me) block scripts with AddOns, for the sake of security. If your homepage is blank when my javascript is off, I’d be hesitant to enable scripts for it. But if I see it’s a trustworthy service, I may go and actually signup. Of course, ajax validation is a must nowadays, but you should have server-side validation anyway, so make your signup form work.
  • display a message “This site requires JavaScript to function properly”. That’s what many sites (including youtube, stackoverflow, and my aforementioned welshare) do. It’s easily handled by the <noscript> tag.
  • content-heavy websites are generally less reliant on javascript. They may use it for paging or comments but it’s not their main functionality, it’s just an “extra”. Such minor features can be supported, it costs you close to nothing (you’d have your 2nd page available for SEO reasons anyway)

Apart from that, the vast majority of services that rely heavily on JavaScript (because they are more applications than sites) should not bother making a JavaScript -off version.

Start coding something amazing with our library of open source Cloud code patterns. Content provided by IBM.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}