4 ms·
It is quite possible to develop semantic, content focused HTML and then at a later point style and re-style with CSS. It is only through laziness and lack of u
by robmcm 11y ago
It is quite possible to develop semantic, content focused HTML and then at a later point style and re-style with CSS.
It is only through laziness and lack of understanding that people couple them together.
- jjnoakes 11y agoExcept this isn't about style. It's about logic. Logic isn't as optional as style, and if you separate the logic into one JS file and the DOM into another HTML file, they are still tied together by the JS binding some action to some named DOM element (by selector, etc). The separation that scales is the one that pairs a small piece of DOM (like a piece of text on the page that updates with the current stock price) to the JS that goes with it, and put that into a single file. Now, build your web page out of components instead.
- robmcm 11y agoSo this is where you enter a slippery slope from web page to application. Developing a webpage and adding progressive enhancements to HTML elements is a strongly advised best practice with numerous advantages. Developing an dynamic application at the complexity of say Photoshop it would be absurd to have a static HTML file with behavior decorated by JavaScript, or try and offer a fallback. Whilst you could in theory perform you photo editing with form submissions and round trips to the server I am not sure it would be worthwhile (I did actually create one circa 2004).
- jjnoakes 11y agoYou can serve static html and progressive JavaScript and still couple the html and JavaScript into components. The structure of your code does not have to dictate the result that is served to the user.
- deleted 11y ago[deleted]