Follow

Here's an idea: a challenge.

Making a website? Avoid using JavaScript.

See how much of the functionality and design you were planning can be done using plain HTML, CSS and other web technologies that are now embedded in the typical browser without needing JavaScript code to do any of it.

Even if it seems impossible, look it up. It just might be possible.

There's so much stuff in there now, even a seasoned webmaster could be surprised.

· SubwayTooter · 14 · 41 · 27

@polychrome i dont use js on my personal page and its clean and simple and you can even make animations with just plain old css

@polychrome Early days and multiply-broken, but I haven't written a line of JS for this prototype and, ugly as it is, the CSS could be improved and I don't plan to add any. morbid-interregnum.cz/index

@polychrome you can do all sorts of stuff without JS, but sometimes managers want you something browser does not support for.

Sometimes there's some basic functionality missing (subtitles).

Sometimes it's supported but only by the newest version nobody uses but developers

Sometimes it's simply not supported at all because community decided to just let people implement it in javascript instead.

And before you say it - yes, you can do all sorts of ridiculous shit with CSS only. Problem is - it's mostly hacks and not manageable.

But yeah. You want a blog post with video in it? Sure. HTML is enough. You want to add interactive image gallery wih 10 images that do not occupy too much space? Now the problems arise.

@hj it's a challenge, not a mandate :blobowo:

Though I'm fairly sure it's possible to make an interactive gallery with 10 images that doesn't occupy too much space with CSS... :thonking:

@polychrome it's possible. but very limited, clunky and unmanageable and probably breaks depending on browser. If the goal is to show it's not impossible then yeah, that works. But I don't think many people in field think that way, they mostly just don't want to bother with it. Not to mention whole shift towards react/vue in the modern days. So if goal is "hey you don't need JS" then the effect would be the opposite - you don't need it but you want it. It's like saying you don't need C and can write assembly code directly, but you really do want some sort of programming language 99.9999999% of the time especially now.

@polychrome Agreed. We got a bit stuck with a shopping cart, and have been faffing around with how to hit the server with successive cart updates then displaying the invoice, Not quite there yet, but mildly confident we're gonna do the whole site JS'less.

@polychrome I also really like the 10k website challenge, less restrictive in what you pick but more in where you put code. Newer forms of that challenge also require everything to work without JS, so you can only use it for progressive enhancement (you know... what JS was meant to be at one point)

@polychrome
On my personal site I use js only for webgl demos. The site is still totally usable without js the user just gets screenshots of the demos.

@polychrome On my website I always use JS when there is no other option, so even with uBlock, uMatrix and NoScript active, no exception are required :)

@polychrome if its for non advanced animations and simple hover effects, or pretty advanced positioning, its totally enough to just add css.

tbh javascript is only good for dynamic "applications" (the whole webapp thingy)
@dirtycommo @polychrome Can confirm, it is awesome.

I'm writing this toot RIGHT NOW in a text-based browser using my no-JS Mastodon client called Planiverse: https://github.com/FuzzJunket/planiverse

Egads! Gadzooks! Zounds! etc.

@polychrome Hmmm I think I can do it. My personal website only has a JS dependency, and I can remove it to use the CSS replacement (it's font-awesome), so...

@polychrome

Why would you avoid using #javascript ?

A different thing of course is to avoid *misusing* JavaScript, which I believe is what your post mainly addresses.

There's also quite a bit of overlap between the different technologies. Sometimes it's obvious what (not) to use, sometimes it's a personal call.

Example of not a good idea: 🙂

experiments.hertzen.com/css3ca

@61 @polychrome But why limit CSS abusues to frontend code? I propose node.css, the world's first server-side framework written entirely in CSS!

@polychrome Gotcha. I can see certain cases where JS-lessness leads to more speed and efficiency, and how it could be a fun exercise to do so.

@polychrome I can also see where it can be quicker and more efficient to use JavaScript and related technologies (shadow DOM, XmlHttpRequest/GlobalFetch, etc.) for certain kinds of pages. I also have a lot of fun with JS doing even small things, especially rewriting common functions from functional programming languages like Haskell and Lisp.

Sign in to participate in the conversation
Cybrespace

cybrespace: the social hub of the information superhighway

jack in to the mastodon fediverse today and surf the dataflow through our cybrepunk, slightly glitchy web portal