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?
Ask HN: Does your web app work with javascript off?
1–10 of 18 posts
Re: Ask HN: Does your web app work with javascript off?
#2In practice though, many sites main functions depend on JS. I can imagine that for large projects the costs of optimizing the view of your site without JS can become too large.
Re: Ask HN: Does your web app work with javascript off?
#3For my personal stuff: Yes... i have a pretty weak browser on my personal phone, sticking to simple HTML is in my own best interests.
Re: Ask HN: Does your web app work with javascript off?
#4Most of my personal projects also require JavaScript because they're things that I build to play around with new technology.
Re: Ask HN: Does your web app work with javascript off?
#5Nowadays - unless you're running some kind of viral service (facebook, twitter etc.) that benefits from masses instead of customers, it's not a requirement.
Still a nice to have, but if people can't update their software, they should 'suffer the consequences'.
Re: Ask HN: Does your web app work with javascript off?
#6I 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.
Re: Ask HN: Does your web app work with javascript off?
#7It will also give you a better appreciation of the places where Web 2.0 can really streamline a system. Just to give an example, Gmail is a massive JS app which uses a frankly unbelievable number of divs to reimplement an iframe window where you can view your email and/or lists of email subjects. It's quite possible that the communications reduction is so big that this is important to Gmail, but you're not that size yet, so just use an iframe rather than reimplementing that functionality in a special way.
There are other situations where JS is a bad technology. I should be able to navigate your site without JS, and if you demand JS for navigation you're probably doing it wrong. I should potentially even be able to log in, if you're not using OpenID or BrowserID or client-side crypto.
AJAX can be useful for creating chat applications, or for situations where you want to be able to see, query, and throw away lots of little pieces of information. Javascript is also useful when you want a control which should never hit the server, like folding a tree of comments -- which I recently implemented as a user script for HN.
That's another plus of using HTML, by the way: it makes it easier for scripters to hack on your site to add their own personal features. I tried to do user scripting on Gmail at one point, it was damn near impossible. Their divs belong to memorably named classes like "vI8oZc cN" and "nH w-asV" and "mq nH oy8Mbf". Such are the perils of trying to build your iframes dynamically out of divs.
Anyway, once you start to get into user interactions, JS becomes much more fun and important. If I am coming to your site to play an HTML5 game, then I already know I need to turn off NoScript, you don't have to tell me. If you've got an interaction which simply screams "drag and drop", then do that instead. Some of the nice uses of JS I've seen recently amount to visualizing graph networks and allow you to drag nodes around to optimize the display; that's a good candidate for a JS implementation.
JS is not merely for facilitation, and can have real uses on a CRUD-type site. Just be sure that you're not reinventing something which already exists without JS, like iframes, URLs, and so forth.
Re: Ask HN: Does your web app work with javascript off?
#8For my personal projects I had thought about allowing for non JavaScript users. I started making sure that things worked under both scenarios but in the end I figured that if you don't have JavaScript enabled you really aren’t going to get use of the main features of the project. So now I don't bother and can use that time for adding more features rather than a user path for a very small minority.
Re: Ask HN: Does your web app work with javascript off?
#9It's a hard choice. 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 fra…
Re: Ask HN: Does your web app work with javascript off?
#10It's a hard choice. 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 fra…