3 ms·
One "alternative" is to do the minimum possible in the browser, and do most of the work on the back end. For example, if you inspect this page, you'll see that
by elevensies 9y ago
One "alternative" is to do the minimum possible in the browser, and do most of the work on the back end.
For example, if you inspect this page, you'll see that it has about 150 lines of Javascript.
There are two ways to change a webpage:
- manipulate it with Javascript
- reload a new page with the changes applied
If your page loads quickly and not all that often, you can get pretty far without Javascript. If you are willing to tolerate a pageload on each interaction, you don't need any Javascript.
- GuiA 9y agoThis advice only applies for non interactive stuff though. What if I want to build a spreadsheet, audio editor, vector-based illustrator, etc. in the browser?
- elevensies 9y agoYeah, if the system can't be represented as hyperlinked documents, then you're going to be married to the browser APIs which are in Javascript -- so you can either use Javascript or a tool that outputs Javascript.
- jasode 9y ago>If your page loads quickly and not all that often, you can get pretty far without Javascript. If you are willing to tolerate a pageload on each interaction, you don't need any Javascript. To put some concrete examples to that... The HN page uses javascript[1] for the upvote/downvote buttons and also to collapse/expand comments. It would be very disruptive and jarring to reload an entire page after someone clicks a vote button. Also, mobile phone users would be doubly punished since a page reload is slower than desktop highspeed internet. A good example of a website not requiring javascript without penalizing user-interface usability is Wikipedia text pages. [1] https://news.ycombinator.com/hn.js https://news.ycombinator.com/hn.js