4 ms·
> The basic idea is that your app should be fully functional even if Javascript is disabled. Honest question, is this really possible? I write webapps and Java
by josephagoss 12y ago
> The basic idea is that your app should be fully functional even if Javascript is disabled.
Honest question, is this really possible? I write webapps and Javascript + Jquery makes a lot of stuff easy, hooking into button clicks, getting text from an input box and sending AJAX requests back to my server.
Does anyone have an example of a web application with no Javascript? My next project will most likely use Golang as the server side, and I'm having a really hard time imagining how to send AJAX requests back to the server on user events (such as the user typing into a box in a real time search application) without using Javascript.
Apparently I've missed a whole area of web development if this is all possible with no Javascript. Isn't this like saying your Windows game should be fully functional without a graphics card?
I mean, on most web applications, they are that, applications. Maybe I just don't know enough, but I feel like I need a programming language in the browser to create the client side of the application, how do I fire off AJAX events when a user types something without Javascript?
I'm honestly trying to learn more here, I need examples of web apps with no Javascript, I need a book or something. Just being told I can replicate my application in html and css isn't helping.
- callum85 12y ago> Honest question, is this really possible? Yes, loads of things work without JS. You can use Wikipedia, even to edit articles, with JS disabled – it's all simple HTML forms. JS just makes the experience smoother (adding buttons to help with WikiText formatting, etc). Most content and shopping websites work fine without JS. You asked how do you fire off AJAX requests without JS? You don't. You just design your app so it basically works as a set of HTML pages connected by hyperlinks and form submissions. Then you add JS to enhance things. > Apparently I've missed a whole area of web development if this is all possible with no Javascript. Yes you have. When I started (~12 years ago), JS was only used for little whizzy effects here and there, not much else. Then JS started becoming more viable due to prototype and jQuery, but it was always the most flakey part of web development, and we learned to use it cautiously as an optional layer of enhancement. You couldn't rely on it always working. It was a way to 'differentiate' your site, not a serious building block. Now, everything has changed, JS is everywhere and we tend to call things 'apps' more than 'sites'. I spend 70% of my day writing JS. I'm not sure if I agree with the JS-bashing sentiment of the article. But I do think it's still good practice to design your app so it delivers your core content/functionality without JS. Most stuff (blogs, e-commerce, forums, etc) can be built like this. (Admittedly some things like p2p streaming apps just can't.) Then you can use JS to enhance things, like enhancing your basic search form with as-you-type suggestions. This approach makes your codebase more structurally sound and less entangled, and makes your app more resilient.
- chase-seibert 12y agoCertainly a number of common interactions are not currently possible (or at least not optimal) without being able to use JS. Maybe some day we can get to a place with web components where many of those common patterns can be implemented with plain old HTML again.
- georgemcbay 12y ago"is this really possible?" Well, sure.. of course it is possible, just a lot more work because the divide between having logic on the client and no logic on the client is quite big thus you often end up needing to solve problems in two ways (and these differences can permeate various layers of the app) and then commit to maintaining both. "such as the user typing into a box in a real time search application" Well you could always just not support real-time search if JavaScript is not enabled. The argument that JavaScript should be optional for all sites sort of pre-assumes that the experience when running sans JavaScript will be different, but you'll be able to get the same things done. In this one specific situation the difference being that you won't get any search feedback until you actually submit the form, old-school web style.
- masoudd 12y ago>Just being told I can replicate my application in html and css isn't helping. You can't. But do you really need to? Couldn't your webpage work without suggestions popping up as query is typed into the input box? Your webpage should not stop working if you can't validate user input client side, etc... . See: http://en.wikipedia.org/wiki/Progressive_enhancement http://en.wikipedia.org/wiki/Progressive_enhancement
- nostrademons 12y agoThe idea behind progressive enhancement is that you prioritize your features, and then make the most fundamental features of your site work without Javascript while still giving JS-enabled users something extra to play with. So in your example - no, you would not send AJAX requests back to the server in a real-time search application. It would not be "real time" at all. But you would still be able to search, and get back results. Then you add JS, and you can search as you type. Relatively few sites do it like this these days - in general, anything that's a SPA that talks to JSON won't work at all with JS disabled. It takes a good understanding of your tools and of your users to prioritize like this, as well as a good dose of humility. But it also often results in better usability and UX design overall, because you know which features are really key and which are "nice to haves", and you don't compromise key features for extras.