5 ms·
Normal websites used to be one file way back in the day. It was a "pro tip" to split out the JS & CSS into a separate files.
by kgc 5y ago
Normal websites used to be one file way back in the day. It was a "pro tip" to split out the JS & CSS into a separate files.
- marcosdumay 5y agoHum... You may be thinking about a page being a file. A site is a collection of those.
- vmception 5y agoA site is a website is the thing behind a domain name. Many were, and are, a single file. Its the rest of ya'll that are overcomplicating things and somehow perverted that to thinking its necessary. How many layers of meta are we right now for this article to be interesting?
- deleted 5y ago[deleted]
- 1123581321 5y agoIt’s probably your use of the word “normal” as it was more common for multi-page sites to either have a file per page or to use cgi.
- petee 5y agoI thought it funny just how many of your respondents decided to charge the semantic hill, completely missing the point. But you know this doesn't use JS, right? (joking)
- COAGULOPATH 5y agoI remember when I made a website with frames and felt like a genius.
- aspyct 5y agoYes! Reusable menus, finally!
- darepublic 5y agoPut your script tags at the bottom of the html page so that when the JavaScript is executed all the dom elements on the page can be referenced. Either that or bootstrap in a window onload callback. I remember picking up and being in awe of secrets of the JavaScript ninja
- kristopolous 5y agoHere's an even bigger secret, if you're doing server-side rendering, putting things on top might actually be better. You're maybe parallelizing things. As the client is downloading and interpreting the css and JavaScript, the server is doing database calls and rendering the HTML. So you actually are doing things on the server side when you're "blocking"on the client. You didn't get this for free. You had to worry about buffers, flushing, and plenty of testing. I don't know if you can still squeak an actual speed up with this technique (there's many attributes you can use to customize things these days) but I used to use it all the time back in the days of platter drives.
- themodelplumber 5y agoNobody knew about this trick back in the day, if it would have even worked. It uses no JS.
- dredmorbius 5y agoWeb pages used to be a single file. This is a web site as a single file, using CSS only. It's a CSS equivalent to a single-page application (SPA), except that this is a single-page site. SPS, perhaps, or maybe a multi-paged file (MPF). Strictly, it requires CSS features which weren't originally present in HTML, though the concept's likely been possible since the early 2000s, if not late 1990s. It does rely on CSS support within the browser, and some simple browsers (mostly terminal-mode clients) won't present the multi-page aspect. The site / page itself remains useful.
- smolder 5y agoThere is no JS here, and it's multiple "pages" in one file.