Hacker News new | ask | show | jobs
by nicoburns 816 days ago
You absolutely can just use HTML. You're writing this on HN that just uses HTML and is one of the more responsive websites on mobile connections.

You can't make as rich an interavtive experience as you can with JS, but you never could.

1 comments

Just because a site is responsive doesn't mean it's HTML. The fact that a lot of people assume that you can't have a responsive site with JS is all the indictment of $current_year front end development you need.

These are some of the JS functions HN runs in the background, on top of the CSS:

    function $ (id) { return document.getElementById(id); }
    function byClass (el, cl) { return el ? el.getElementsByClassName(cl) : [] }
    function byTag (el, tg) { return el ? el.getElementsByTagName(tg) : [] }
    function allof (cl) { return byClass(document, cl) }
    ...
I didn't say you can't have a responsive site with JavaScript, I said that you can have one with plain HTML. HN may use JS for a few things (upvotes?), but it's mostly full page reloads including for loading threads and posting comments.