logoalt Hacker News

jason_osterlast Wednesday at 7:03 PM1 replyview on HN

Are you sure about that? Most of the mid-2000's jQuery components bundled their HTML and CSS in bespoke template strings within JS. If you remember, jQuery's `.css()` method accepted JSON to set CSS properties, and `.html()` accepted a string to set the inner-HTML.

And if you needed to manipulate strings to generate HTML, you'd be doing so with some kind of template mechanism, like string concatenation or substring substitutions. John Resig, author of jQuery, wrote Secrets of the JavaScript Ninja in 2008 [1], offering a small templating engine that does exactly that. The first commit in the Underscore library credits this book for their `template` method [2].

I think your chronology is skewed or confused. "SPAs" have been brewing in some form since the mid-2000's, when people stopped writing plain old HTML and CSS. Everything was jQuery UI widgets and AJAX, Prototype and Underscore templates. HTML died a very long time ago.

[1]: https://blog.codinghorror.com/secrets-of-the-javascript-ninj...

[2]: https://github.com/jashkenas/underscore/commit/02ede85b539a8...


Replies

sarchertechlast Thursday at 3:22 AM

I’m 100% positive. I was very involved in the CSS community back then.

The ability to do SPAs existed, but the vast majority of people weren’t building them. The time period you’re talking about was peak rails erb templates. Which is definitely “writing html by hand”.

I knew plenty of people who were getting paid to convert psd mockups into HTML/CSS around that time. There was a whole industry around hand written psd to HTML, which was eventually mostly outsourced to India.

In 2008 I made most of my money making static brochure sites for small/mid-sized businesses. Most small businesses around that time had something similar. It was very easy back then to browse most of the web with JavaScript disabled.

show 1 reply