4 ms·
I admit that JS brings a whole lot of simplicity to situations that would be tedious otherwise. The problem is that the maliciousness that can exist with js can
by cmroanirgo 6y ago
I admit that JS brings a whole lot of simplicity to situations that would be tedious otherwise. The problem is that the maliciousness that can exist with js can sometimes outweigh it's usefulness.
Looking at HN, which uses js for voting, can be replaced with the olde-school form submission method (at increased page reloads etc), so clearly JS is doing us a favor.
But many sites we visit are consume only (blogs and news) and the rest are generally what we interact with only very infrequently (HN, fb, twitter). It's a rare site that actively needs js (excluding all those react/vue architected sites) that doesn't need human interaction on the first place (eg slack and chat sites that need streaming/comet server responses)
Random thought: Maybe we could investigate a methodology of "jit" for js in response to human interaction. Browsers already do this to limit access to the clipboard functionality. That is, js will run only if the user clicks on a button, etc, but is otherwise dormant (even document.onload would be delayed until first click). Anything else would require permission to run. Of course, this would break the web as it exists now.
- chrismorgan 6y ago> Looking at HN, which uses js for voting, can be replaced with the olde-school form submission method (at increased page reloads etc), so clearly JS is doing us a favor. The JS here is is an optional enhancement that does the vote in the background. Disable JavaScript and voting still works, it just causes the page to reload. (Aside: it works by using links, but forms so that it’s a POST would be better.)