last day (15 days later) » 

14:40
-4
Q: Is it bad practice to use Javascript when some people disabled it?

ralphsmitI'm building a website and I used some Javascript in it. The code is actually very simple (when a user clicks on a specific div, a few divs are given an additional class, which activates new CSS code and a CSS transition happens). I used this for the hamburger menu, so I could animate it. The t...

I don’t know of many modern websites that can operate with javascript disabled. Usually you just put something in a noscript tag that informs the user they need to enable javascript to use your site
> is using Javascript bad practice in web design? No. > The thing is that the hamburger menu won't open when people have their Javascript disabled What if that menu were open by default, and you only closed it with JavaScript? Best practice on the web is all about progressive enhancement. If there's anything you can do to support folks who are using alternative user agents, then you should. It's not just people who have JavaScript disabled... it's crawlers, console browsers, alternative inputs, old screen readers, etc.
nowadays it's a bad practice to disable javascript at all. Just don't care about users who have JS disabled
This question shouldn't have been closed. It's definitely not strictly opinion based... there's a real factual question here.
It varies. Some websites you can't really do without JavaScript, as they require interactivity. Other sites might just prefer not to support non-JS features - it's a valid choice. Others still may have graceful degradation and offer comparable user experience even without JS.
14:40
this is not really opinion based due to it is not really possible to write modern websites without using JS (there are alternatives but to be honest - javascript rules them all)
@messerbill Of course it's possible to build modern websites without JavaScript... Depends entirely on what you need to do.
@bryan60 this is actually the wrong outlook. Sure you could choose to ignore no JS support but it has to be an informed choice as opposed to a default assumption. If your website works without JS enabled, then you're on a very good track for it to be accessible to many people and even tools. If it relies on JS too much, then some screen readers, for example, might have an issue. Certain web crawlers or tools for static processing of pages will also be hampered.
@messerbill ok, so your opinion is that you cannot build a website without JS? Because I know for a fact that you can.
Rob
Rob
No matter what people say, this is a UI/UX question, not a programming one, and it's off topic here. stackoverflow.com/help/on-topic
@Brad how to achieve loading data without requesting a new page? how to make dynamic DOM manipulation?
@messerbill forms are always an option, you know...the backend can also build your pages for you. As was always the case.
14:40
@messerbill Your definition of "modern" is interesting...
@VLAZ of course but this will automatically lead to more traffic....nowadays many pages are opened using mobile devices. I don't want to argue at all....stick to your SSR (even if there are good reasons for 90% of all web apps why they don't make use of SSR....)
@Brad helpful. Thank you for that.
A few things you can do with no JavaScript that used to require a lot of JavaScript: Audio/video streaming. Animation. Hover styling. (In fact, that may be an option for that menu... not the best from a usability perspective, but possible to override in JS later!) Deferred loading of fonts. Audio/video/photo capture. Force-a-download. Vector graphics, with animation. Probably 100 other things...
@messerbill you don't want to argue...and then you go and strawman me? You're putting words in my mouth there, which is a sign you want to win an "argument".
@VLAZ no I think my outlook is correct. Your default assumption in modern web is javascript required, and only special cases you support no Js. Every important web crawler supports js at this point, and as far as I know, accessibility is not at all impacted by js. These concerns of yours are outdated by about 10 years tbh
@VLAZ where did i put any words in your mouth? you said that the backend can also build pages, didn't you? Thats what SSR is....anyway. May be opinion based. Have fun disabling JS
Rob
Rob
14:40
I'm voting to close this question as off-topic because because it is about the user experience and not a programming question. Ask, instead, on ux.stackexchange.com
Thanks all for your insights. I see that there are a lot of differing opinions ;). If I'll come up with a way to replace Javascript I'll certainly use that, and otherwise put sth in the noscript tag.
@Rob I think it's a bit on the edge of programming and ux, because it is about the choice for Javascript (yes or no) and offering an alternative, while the ux part is only about not offering an alternative to users that have disabled javascript.
@bryan60 Thanks for the idea to use the noscript tag!
@Brad Thank for your suggestion about the menu!
@messerbill Thanks for sharing you opinion :)
@VLAZ It is indeed true that search engines and other tools might be hampered, but only the appearance changes (opacity, position etcetera).
Rob
Rob
And that's why others voted to close this as opinion, too.

last day (15 days later) »