2 ms·
> It's always annoying when you attempt to click a link only to find it won't work unless Javascript is enabled. Ah, the number of times I've asked colleagues
by chriswarbo 12y ago
> It's always annoying when you attempt to click a link only to find it won't work unless Javascript is enabled.
Ah, the number of times I've asked colleagues to stop doing this! If you want a JS-powered link/button/whatever on a page, insert it using JS; then you're guaranteed that it will only show up for those who can use it.
Likewise, all togglable content should begin visible, and selectively-hidden by JS during page load; that way, it only gets hidden for those users capable of showing it again.
Also, although this is rarer, all work should be done in small, isolated event handlers. That way, when some unexpected situation arises (eg. the user is blocking your chosen spyware platform), that particular handler dies, but all of the rest keep working (eg. the button handlers, the slideshows, etc.).
- krick 12y agoThe truth is almost nobody cares about js being disabled anymore. Even if today you think it's an overestimating (I don't think so anymore) over few more years it won't be even for you. Just 2 years ago it was like "What if a customer doesn't have js enabled? We don't want to loose him just over that! Let's support both versions.", today it is already more like "No js? Weird, lol. Well, it's his own problem anyway, no reason to spend time&money on that in 2014.". When I for some reason was forced to use lynx, which I don't normally do, I was simply amazed by how smooth browsing is, it doesn't feel like the usual "internet" anymore, more like navigating your project via text editor on the local filesystem. But unfortunately as you go further than browsing ArchWiki it becomes almost unusable due to lack of static (in the sense "no js") sites support.
- seanp2k2 12y agohttp://stackoverflow.com/questions/764624/how-can-you-use-javascript-in-terminal-for-w3m http://stackoverflow.com/questions/764624/how-can-you-use-ja... W3m-js is/was a thing. Also, w3m can apparently draw images inline via xterm, though I wasn't able to get this working in the ~10 minutes I tried on OSX Yosemite with X11 and xterm using the w3m from homebrew. UZBL is ok too, if you just want a minimalistic WebKit browser with vim key binds.
- krick 12y agoIf you want vim-keybinds in your browser you can just use vimperator or pentadactyl, it's not the point here. Web without pictures/js on today's connection is almost as smooth as navigating your local file system, while "normal" browsing isn't, and you (well, me) don't even notice that before you eventually try that js-free browsing from lynx or something like that. That is, it would be if not for the fact that js-free web is a "Red Book animal" already.
- chriswarbo 12y ago> no reason to spend time&money on that in 2014 If you're considering whether to go back and change it, don't bother; you've failed. The point is to do it that way the first time, instinctively. The time&money spent writing element-inserting JS corresponds to time&money saved by not adding a bunch of links/buttons/etc. to HTML templates. If you're tied into a framework which makes the right way more difficult, then file a bug with the framework devs ;)