Often when picking new tools and frameworks I see the warning "Will not work if the user has disabled Javascript". I then look at my Javascript powered slideshow, Javascript powered menu, and Javascript powered gallery. Funnily enough, I chose these to replace the original flash based versions since I worried about the number of people that would see them.

But is worrying about people disabling Javascript a legitimate worry? Should I try and design my site with JS being disabled in mind?


That depends on the site, its purpose, and who the demographic is.

If you're designing a government website, a banking site, a corporate home page, etc, then you absolutely should make sure the site works without JavaScript. But if you're designing an entertainment/leisure site like Twitter or Facebook, then it's not so bad to require JavaScript. And if your site is a rich internet application that absolutely won't work without client-side scripting (e.g. Meebo), then it's absolutely reasonable to require JavaScript.

Most features on a typical website probably shouldn't require JavaScript though. It's fine to center the user experience around clients with JavaScript enabled, but if you're running a forum, you should make sure that users can still post/read messages without JavaScript, even if it means the interface is more basic.

| improve this answer | |
  • 4
    The requirements for government or public websites that Lèse mentioned is called 508 compliance: section508.gov – XOPJ Nov 1 '10 at 1:53

I'm surprised no one mentioned progressive enhancement. There's rarely a good reason to have functionality or content that requires JavaScript to work. Yes, JavaScript can make the user experience better, but it shouldn't be required to make the user experience possible.

So my answer is, you should build your website so everyone can access everything, even without JavaScript (assuming publicly available content. Site admins, intranets, etc, would be obvious exceptions as you can realistically dictate browser requirements in those situations).


Oh, yeah. This is search engine friendly too. JavaScript is not.

| improve this answer | |
  • Lets see, Javascript based drop down menu's since I have yet to see a pure CSS based one that works (the drop down menu is an actual requirement), a Javascript slideshow on the front page to replace the old Flash based one since flash is... flash (required), and a Javascript gallery which was used to enhance usability and friendliness of the interface (never did like it when expanded pictures were just opened in a new tab, and in my case it would look and act horrible). Not really any alternatives – TheLQ Nov 1 '10 at 3:08
  • 1
    "since I have yet to see a pure CSS based one that works". I use CSS menus and they work very well, can you elaborate more on that part? – Mee Nov 1 '10 at 4:55
  • 3
    @Waleed: One potential problem with purely CSS-based dropdown menus is that they're too responsive. Good JS dropdown menus have a delay for mouseout events to avoid the diagonal problem (when temporarily leaving the parent menu item before reaching the submenu item). You can't do that with CSS, so you'd have to design your menus in such a way that the user will only ever move their mouse vertically or horizontally to get to submenu items. However, I agree that you should start with a CSS-based menu and progressively enhance it with JS so that JS isn't necessary for basic navigation. – Lèse majesté Nov 1 '10 at 7:15
  • 1
    @Lèse, while you can't have a delay with CSS menus, there are tricks to get around this and surprisingly they actually work very well (for example see cssplay.co.uk/menus/final_drop3.html). Also, check the demo at cssplay.co.uk/menus/vertical-list.html to see how complex CSS menus can be. By no means this means that I'm trying to advocate against using javascript for menus. All I'm trying to say is that, if it can be done without javascript then why use javascript esp. for something as important as the site navigation? – Mee Nov 1 '10 at 11:10
  • 2
    @TheLQ, everything you mentioned can be done without JavaScript. And the JavaScript you mention is only an enhancement. All perfect examples of when progressive enhancement should be used. – John Conde Nov 1 '10 at 11:58

Nicholas C. Zakas informs that around 1% of the actual visitor traffic to sites on the Yahoo network make JavaScript-disabled requests.

...the overwhelming majority of users has JavaScript-enabled browsers and can therefore take advantage of all of the enhanced functionality and dynamic interfaces developers and designers love to create. From a planning standpoint, it makes sense to spend more time on the experience that the largest numbers of users receive, knowing that your time investment is well worth it.

So find out the stats for your own site & build it so that it benefits the majority & still degrades gracefully for those who have JS disabled.

| improve this answer | |

Worrying is not needed, no.

Having said that, making your website accessible and usable is a good idea. Usually heavy use of JavaScript and accessibility don't go hand in hand all that well.

So as long as your website is still usable with JavaScript off, you are in good shape. Even if the website does not necessarily appears as great as you would wish it to look like anymore.

| improve this answer | |

Facebook will not work without JavaScript. What I have learned is that most people that don't have JavaScript are probably not going to subscribe to your product. We use JavaScript to enhance a user's experience, but don't make it a requirement.

So your site should work without JavaScript, but it doesn't have to look good. Chances are if someone is visiting your site without JS turned on they are a BOT, a Hacker, a 99 year old, or a weirdo on a dial up connection trying to speed things up.

If you offer a commercial product, SAS, or cloud app don't even worry about this small percentage of users. Its not worth the development time, and again they will probably never subscribe to your service.

If you are using JavaScript to store shopping cart items in an eCommerce store, then I would look at the architecture and make sure that you offer a non js functionality.

| improve this answer | |
  • I know what you're getting at, but your site ought to look good with or without JS. JS really shouldn't be required to have a beautiful site. – Lèse majesté Nov 1 '10 at 7:18
  • I agree on that... But lets say you have a menu that only shows when javascript is enabled, or maybe tool that uses heavy javascript, then i wouldnt worry about building 2 versions just to satisfy a small share... 80/20 rule applies – Frank Nov 1 '10 at 7:34
  • 2
    Just make sure that menu is for a JavaScript-only feature or a non-vital enhancement, like a WYSIWYG editor. Your site should be navigable without JavaScript. Otherwise, it's worth the time to make a menu that is also visible without JavaScript. – Lèse majesté Nov 1 '10 at 8:53
  • 1
    Progressive enhancement doesn't require building the site twice. And if your site doesn't mind losing out on 20% of its potential revenue then that's fine. But try telling someone you willingly gave up 20% of your revenue just because you didn't want to do a little bit of extra coding and see what their response is. Try that with a client, too. – John Conde Nov 1 '10 at 12:06
  • Yeah but in this case its really not 20/80 more like 1/500 . We just recently finished building a high end site for a partnered venture using cappuccino wraped in an adobe air ajax application. The app would never run properly or even at all with javascript turned off. I think every application is different, but again it tells me a lot when facebook wont work without javascript turned on. My rule is if you are selling something allow for the sale to happen without javascript, beyond that javascript is a must. – Frank Nov 1 '10 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.