by somat · 2y ago · 0 comments
True story. I am the worlds worst web programmer, that is I am not a web programmer, I am a sys-admin that occasionally makes web based tooling. And as such my web skills are stuck in the early 2000's. On top of that I have this terrible aversion to javascript(I am already writing a code generator in one language to create a second language, now you want me to throw a third language on top of that... no thanks). On one of my recent tools I needed to do some basic operations involving points on a picture. it probably would have been 5 lines of javascript, the only 5 lines of javascript in the whole infernal thing. No thanks, I won't be having any of that in my program, I am going with server side image maps... in 2023... yeah. So now instead of 5 lines of JS I now have 50 lines of python managing state and a special case in the request handler to handle the screwball fragment syntax.
I cringe a little, but am also strangely enough, a little proud of getting the thing to work at all.
Try
$ wget http://web.archive.org/cdx/search/cdx?url=http://example.com/*
for a list of every archived page from the site. It won't include pages archive.org doesn't have, but without the original server, there's no way to get those anyway.If the imagemap is serverside, how does the IA archiver know where to click?
:(
Sadly, after I fixed the Chromium bug, I decided the server-side image map sucked and I wrote the JavaScript anyway. The JavaScript version is better :(
I feel exactly the same way. HTMX is a godsend. That and a Tailwind UI purchase can make anybody very dangerous at frontend. I'm curious for other viewpoints though: what exactly about js gives that icky feeling. For me it's just the inconsistent syntax. With TS, on the other hand just seeing a node modules folder makes me nauseous. The whole thing gives me a feeling of a lack of control over what's happening and has thrown me off front end for many years until now
I tend to write my web apps in what is referred to today as server side rendered(Which sounds stupid to me, I am not rendering anything, I am outputting html for the html terminal to render) as such, all my logic is on one end, and mixing in logic, in a different language, for the other end feels really ugly.
I have recently tried to be a better person and get more comfortable with javascript. What I have found that works is to completely invert the logic dynamics, give the browser a single static page that has nothing in it. only a single script tag that includes a javascript file. Then generate the whole page from that. Now all your logic is still in one language[1] and really javascript is a lot of fun to write, the language is still sort of crap, but now the dynamic stuff is really simple.
1. as a footnote, the great tragedy of the web is that (script language=) only works for javascript. wasm is an attempt to rectify this, but I think that while they are doing the best they can with the shitshow they have to work with. wasm is solving the problem at entirely the wrong layer.
And you often end up with server side rendering as well (hopefully provided by your framework) to make initial page loads faster.
Ya sick bahstahd! ;]
Hey there now, you can't just lay claim to my title without first beating me for it in a title match.
a few dozen lines of lisp later and I had a web server that served up an image map of the screen, and would respond to image-map requests by inserting a click. A nice little one-off to save me the round trip to work.
Then COVID happened and this tool got used by way too many people. For all I know someone is still using it.
i get it. i hate being in charge of UI. i'm a backend type through and through. however, i do have to do it much more regularly than you. i refuse to use libraries. so i've kept up with the changes to CSS since the early 2000s, and you can do some amazing things with it. i think it fits your "get off my lawn" style and can't recommend enough teaching an old dog new CSS tricks.
Edit: left out enough which is totally the opposite of intended point
Nah, just use a client-side image map. Image maps are not deprecated, they still work in browsers, and you can use polygons to create shapes that would be difficult in CSS.
still use one almost daily for getting weather data in my area lol
In conclusion. there is no way to send an arbitrary point using client side image maps. a task server side image maps specifically solves.