Live data from Hacker News

Vanilla JS, fast, lightweight, cross-platform framework

vanilla-js.com

11–20 of 134 posts

Re: Vanilla JS, fast, lightweight, cross-platform framework

#15
post #10

Recently, I was interviewing a front-end developer candidate and I gave them a simple JavaScript problem. The sad thing was, they didn't recognize `document.getElementById()` and didn't know any of the parameters to `addEventListener()`. We finished the exercise assuming the example used jQuery instead.

It's a common problem nowadays I guess. I honestly don't remember the last time I worked on a project with plainjane javascript.

There always is either underscore or backbone or require or dojo or prototype or yui or jquery...

Don't really know if this is good or bad!

Re: Vanilla JS, fast, lightweight, cross-platform framework

#16
post #9

Fast and lightweight, yes. But vanilla-js is certainly not cross platform ;) You see, that's actually one of the biggest problems with JS and one of the main reasons why people use things like jQuery (apart from the pretty API..). That cross platform bit is the weakest link sigh .

jQuery API is not pretty

Re: Vanilla JS, fast, lightweight, cross-platform framework

#18
post #16
post #9

Fast and lightweight, yes. But vanilla-js is certainly not cross platform ;) You see, that's actually one of the biggest problems with JS and one of the main reasons why people use things like jQuery (apart from the pretty API..). That cross platform bit is the weakest link sigh .

jQuery API is not pretty

I'll take

  $('p').text('Hello.')
over

  for (var p in document.getElementsByTagName('p')) { p.innerHTML = 'Hello.'; }
any day!

Re: Vanilla JS, fast, lightweight, cross-platform framework

#19
post #16
post #9

Fast and lightweight, yes. But vanilla-js is certainly not cross platform ;) You see, that's actually one of the biggest problems with JS and one of the main reasons why people use things like jQuery (apart from the pretty API..). That cross platform bit is the weakest link sigh .

jQuery API is not pretty

Compared to the dom api, it is very pretty.

Re: Vanilla JS, fast, lightweight, cross-platform framework

#20
post #18
post #16

Earlier quoted context omitted.

jQuery API is not pretty

I'll take $('p').text('Hello.') over for (var p in document.getElementsByTagName('p')) { p.innerHTML = 'Hello.'; } any day!

innerHTML is an easy one, try setting an attribute -- you have to create a new attribute node, set its value and then add that to the element..
Post reply on HN