0

I did some Javascript back in the late 90s and got moderately fluent with it but finally drifted away because it was such a pain to make it work right in various different browsers, each of which had their own eccentricities. A lot has changed since those days with the advent of JQuery and various Javascript frameworks. I'm toying with the idea of getting back into Javascript, perhaps via JQuery or one of the frameworks, but I've got one fundamental question that I need to have answered before I decide: do all Javascript developers simply assume that Javascript is turned on in their users' browsers? If not, how are they handling users who DON'T have Javascript turned on?

Back when I used Javascript, you used the NOSCRIPT tag to tell people that the page wouldn't work and, in effect, told them to turn on Javascript or don't bother staying on this webpage because it wasn't going to work for them. Is that still the basic approach?

One other related question: just how common is it for people to have Javascript turned off these days? Or to put it another way, what are the most common situations where people have Javascript turned off?

Putting on a project manager hat, if I were trying to choose how to build a website and selecting the tools/technology, I think I'd be quite reluctant to use Javascript if a significant part of the user base was going to have Javascript turned off. That would ensure that some significant number of people weren't going to see/use the pages I was creating OR it would force me to do everything TWICE, once in Javascript and once in some other language. (For instance, I could have a form and do validations in Javascript when people had it turned on but do equivalent validations in something like PHP for those who have Javascript turned off.) Losing a bunch of users is not likely to be satisfactory to whoever wants me to build this website and having to do everything twice is not going to be a positive thing for my development budget because I've got twice as much code to design, develop, test and maintain and would very possibly make me hire more people to do the work.

I'd like to know just how people rationalize using Javascript in 2019. I know Javascript is widely used so the benefits must still outweigh the negatives. I just want to know what the arguments are for using Javascript despite the negatives.

Henry
  • 1,395
  • 1
  • 12
  • 31
  • 1
    The argument for using Javascript is simple: it gives you programmatic capability in the browser. Tell your users to ditch Windows XP and get with the times. – Robert Harvey Mar 23 '19 at 19:53
  • Good way to start is get more informations about Progressive Web Apps. – Kamil Naja Mar 23 '19 at 19:54
  • Lots of questions there. Look [here](https://www.smashingmagazine.com/2018/05/using-the-web-with-javascript-turned-off/). This might answer a few, though it doesn't go into programming in JS in depth. –  Mar 23 '19 at 19:55
  • 1
    *do all Javascript developers simply assume that Javascript is turned on in their users' browsers* In today's world, turning JavaScript off is tantamount to breathing without oxygen. This is a non-issue. JavaScript is a fundamental component of the web. – Scott Marcus Mar 23 '19 at 20:08
  • [Progressive enhancement](http://en.wikipedia.org/wiki/Progressive_enhancement) is still a best practice. Unfortunately many devs are abandoning it because using a clientside JS framework is simpler (read: cheaper) than doing rendering both on server and client. As always, the answer is *It depends* - on the audience, the content, and the features you want to implement. – Bergi Mar 23 '19 at 20:15
  • @RobertHarvey - I don't understand your putting this question on hold. I was looking for FACTS, not opinions, specifically the facts of what developers do to handle the cases where a system is built that depends on Javascript to some extent but the user has Javascript turned off. I am trying to understand if this is no longer an issue or if people with Javascript turned off are simply ignored. That seems like a very fact-based question to me. – Henry Mar 24 '19 at 23:50
  • Then quit asking for opinions in your questions. If you can remove the Javascript rant, I'll reopen. – Robert Harvey Mar 24 '19 at 23:56

1 Answers1

2

(Strong use of exageration ahead)

If you care about reaching a sizable audience:

Everyone uses Javascript. It is everywhere. Everyone has it turned on.

<noscript> comes in handy for web crawlers.

No one builds sites intended for human users with <noscript> anymore.

There is also this: Browser statistics on JavaScript disabled

This is also interesting: https://www.screamingfrog.co.uk/crawl-javascript-seo/

David
  • 2,715
  • 2
  • 22
  • 31
  • 1
    Most web crawlers can handle javascript since they use a headless browser to gather the data. – Get Off My Lawn Mar 23 '19 at 20:02
  • Hah, I was just editing in that last link about the SEO aspects, and how they have changed. – David Mar 23 '19 at 20:02
  • I dabbled with some of that old #! stuff back in the day, and it was a real pain. – David Mar 23 '19 at 20:03
  • *Everyone* is wrong. There is definitely a minority who still uses noscript, scriptsafe or similar browser plugins to only allow js on selected pages, for fear of spectre [or something else](https://softwareengineering.stackexchange.com/a/26186/66652). I can't tell how large this minory is, though. – Bergi Mar 23 '19 at 20:05
  • 1
    I've edited, to call out what I thought was obvious use of hyperbole. Although, in the spirit of trying to help the user asking the question, I can't in good faith recommend handling that small percent of users for most practical applications. – David Mar 23 '19 at 20:10