@HiddenLayer555@lemmy.ml
creator
link
fedilink
53•
edit-2
1M

deleted by creator

One of the biggest reasons websites need to run JS is submitting form data to a server. Like this website.

No. Forms function quite perfectly without JS thanks to action=.

Now whether you want to get “desktop app” fancy with forms and pretend you are a “first-class desktop citizen” that’s a skill issue. But submitting form data, by itself, has not required JS since at least 1979. Maybe earlier.

Another major reason for using JS is dropdown menus and panels. You need to either write code to listen for the click and reveal/hide it as needed, or you have to do weird CSS tricks that are usually inferior in UX to a JavaScript implementation, or you have to bastardize the form dropdown selector into your general purpose dropdown.

Look for text “HTML’s got expandable sections baked in”

I had actually given up on expandable sections for my website (because I didn’t want anymore JS than the dark/light switcher I made) until I found this.

fmstrat
link
fedilink
1•1Y

Let me introduce you to my little friend the iframe…

ofc it would be horrendously inefficient, but can you use multiple iframes to do asynchronous forms?

Zagorath
link
fedilink
8•1Y

I agree with you about dropdown menus being something that could/should be natively available to HTML, but I’m less convinced about form submission. Sure, if we assume everything is happy path it’s a great idea, but a system needs to be robust enough to handle a variety of cases. Maybe you want to redirect a user to a log-on page if they get back a 401, or present an explanation if they get a 403. A 5XX should usually display some sort of error message to the user. A 201 probably needs to add an element into the page, while a 200 might do nothing, or might alter something on the page.

With the huge range of possible paths and desired effects, it pretty quickly becomes apparent that designing an HTML & CSS–only spec that can meet the needs is infeasible. There’s definitely a case to be made that JavaScript has become too powerful and can do too many potentially dangerous or privacy-invading things. And maybe a new range of permissions could be considered to limit a lot of that at a more fundamental level. But what we’re talking about here with the form submission stuff is the real bare-bones basic stuff JavaScript was designed to make easier—alter the contents of web pages on the fly in response to user actions. And it’s really, really good at that.

warm
link
fedilink
14•1Y

I miss websites with simple text, links and graphics. We could navigate them perfectly fine without any JS, any dropdowns or whatever. They just displayed the information you came for, nothing extra.

who
link
fedilink
23•
edit-2
1Y

Let’s be careful how we phrase things here. JavaScript form submission and navigation are choices, not needs.

Also, progressive enhancement / graceful degradation exists. When competent developers (or bosses) want script effects on our sites, we can include them and make the sites continue to function with scripts disabled. It might require more work, but it is absolutely possible.

Framing the script-based approaches to these things as if they were needs contributes to the problem, IMHO.

(I am referring to the vast majority of web sites, of course, not special-purpose web applications like games.)

Navigation is a need.
It can be done without JS

You don’t even need to be competent. Being obsessed works too.

The problem is, a manager will just get an intern with 0 web experience and hand them WordPress.

I’m am ex web dev/des and still maintain some websites for non-profits. I think you underestimate the human stupidity factor. I already have to front an infuriating level of stupid questions and problems that people have caused themselves by not following the most simple of directions. Do I like JavaScript? No. Do I wish I could completely ditch it? 100%. But people are stupid. And without it’s use, I would be handling even more CS than I am now. The average person expects a website to act a certain way and without that they lose their minds.

Homie the web platform I’ve been tasked with helping keep running/update is ASP Web forms and the lack of asynchronous updating is pretty annoying to work with in a ticketing software.

Create a post

A place to discuss privacy and freedom in the digital world.

Privacy has become a very important issue in modern society, with companies and governments constantly abusing their power, more and more people are waking up to the importance of digital privacy.

In this community everyone is welcome to post links and discuss topics related to privacy.

Some Rules

  • Posting a link to a website containing tracking isn’t great, if contents of the website are behind a paywall maybe copy them into the post
  • Don’t promote proprietary software
  • Try to keep things on topic
  • If you have a question, please try searching for previous discussions, maybe it has already been answered
  • Reposts are fine, but should have at least a couple of weeks in between so that the post can reach a new audience
  • Be nice :)

Related communities

much thanks to @gary_host_laptop for the logo design :)

  • 0 users online
  • 108 users / day
  • 246 users / week
  • 454 users / month
  • 1.13K users / 6 months
  • 1 subscriber
  • 5.06K Posts
  • 123K Comments
  • Modlog