Earlier quoted context omitted.
If you'll look at the comment below, you'll see a rather interesting discussion going on. Jokes can be an effective way to start a dialogue.
You're right. And now I feel bad that my whiny comment is the top-rated one, edging out that interesting discussion, but oh well. Hopefully I motivated people to prove me wrong. :)
Vanilla JS, fast, lightweight, cross-platform framework
71–80 of 134 posts
Re: Vanilla JS, fast, lightweight, cross-platform framework
#72Re: Vanilla JS, fast, lightweight, cross-platform framework
#73Earlier quoted context omitted.
You're right. And now I feel bad that my whiny comment is the top-rated one, edging out that interesting discussion, but oh well. Hopefully I motivated people to prove me wrong. :)
Actually accepting that you had a whiny comment is what's keeping you on top, hehe. Anyways, I felt the same way, oh man another fake library that complaints about frameworks & libraries. It's alright these have to repeat from time to time, not everybody saw the last one, etc.
Re: Vanilla JS, fast, lightweight, cross-platform framework
#74Re: Vanilla JS, fast, lightweight, cross-platform framework
#75Re: Vanilla JS, fast, lightweight, cross-platform framework
#76Earlier quoted context omitted.
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..
Erm... no you don't: http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-F68F082
Re: Vanilla JS, fast, lightweight, cross-platform framework
#77I love pure JavaScript. jQuery is overrated and most libraries are only good for one thing or the other, nothing can replace the joy and performance of Vanilla JS!
jQuery is kind of a big download for mobile, so I often skip it for small tasks. What gets me is when people include jQuery and then further bog things down by loading a lot of plug-ins to do things that could easily be accomplished by adding a few lines of code of their own. Even if you do need and include jQuery, it doesn't mean you have to use it for every piece of javascript in your app. Many times, a plug-in wil…
That's what Zepto[0] is for: jQuery's API, 20% of the size (although it drops some features, e.g. $(selector) is pretty directly proxied to document.querySelectorAll, so $('> .foo') works in jQuery but blows up in Zepto)
Re: Vanilla JS, fast, lightweight, cross-platform framework
#78Re: Vanilla JS, fast, lightweight, cross-platform framework
#79Earlier quoted context omitted.
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..
> you have to create a new attribute node, set its value and then add that to the element.. Erm... no you don't: http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-F68F082
Re: Vanilla JS, fast, lightweight, cross-platform framework
#80Question: is the 'Speed Comparison' for real? I find it really, really hard to believe. Surely jQuery & co. revert to native implementations (if they exists, as they do in all modern browsers) for things like `document.getElementById` and don't iterate over the whole DOM.