|
|
|
Ask HN: Does your web app work with javascript off?
|
|
12 points
by sparkygoblue
5193 days ago
|
|
I've spent a lot of time adding UI features to my new (mostly CRUD) webapp that I know I'm going to either tweak or totally override via javascript/ajax. I feel an obligation to get the app working with no javascript/jquery, even though I know that the group of people using the site with javascript turned off are going to very small. Is this the "right" way to be doing this? Should I just be using javascript based UI elements and ajax from the start? Is there a standard practice with regards to this issue? |
|
I was recently involved in a project that was heavily focused on progressive enhancement - we started with a "standard" HTML app with forms and submit buttons. Every interaction required a full page load.
Then we started using Javascript to enhance the UX in such a way that it still worked without Javascript. It was a long and tricky process, because progressive enhancement is inherently quite fragile. You are basically taking an app, and then monkey patching it at runtime to be a different app. This is hard. :) Any change anywhere ripples through the whole app, and the entire thing is an offence against DRY; you are duplicating logic over and over and over.
Still, after a lot of time and effort... ...we gave up. We just couldn't get a slick, user friendly experience with JS, without the site breaking without JS. And frankly, the UX without JS was terrible anyhow. We rewrote the thing as a SPA (single page app). The codebase is much simpler, and the UX is great. :)
For us, the biggest pain point is our initial design had a server the emitted HTML; and accepted forms POSTed back to it. To enable AJAX, we then needed to duplicate a bunch of functionality so it would accept and emit JSON as well; this led to major headaches trying to keep all the logic in sync. If you DO want to maintain progressive enhancement...you need to figure out your site design from the start; it can't be an afterthought! If it's a complex project, you will live and die by your ability to keep your code DRY and enforce Seperation of Concerns.