News for hackers. Stuff that matters.
Re:Native equivalents of jQuery functions by jbri on Monday May 20, 2013 @06:44AM (#5736885)
Why not use a polyfill to get the same functionality on older browsers? That also gives you the benefits of better performance on browsers that do support the native version.
Re:Native equivalents of jQuery functions by ckuijjer on Monday May 20, 2013 @07:06AM (#5736950)
jQuery uses getElementsByID, getElementsByClassName etc. when available in the browser. There is only a small overhead in parsing the selector to see if it's e.g. a simple ID or class selector.
Re:Native equivalents of jQuery functions by octatone2 on Monday May 20, 2013 @07:49AM (#5737095)
Or should create a DOM element. I think the main pitfall of $() is that it tries to be too many things at once. Node creation and selection should be two separate slimmed down functions. There's no need (other than convenience) for selection and creation exist in the same function.
Re:Native equivalents of jQuery functions by kibibu on Monday May 20, 2013 @07:58AM (#5737126)
And onDocumentReady handling :)

You can do this:

    $(function() { /* handle onDocLoad */ })
Re:Native equivalents of jQuery functions by octatone2 on Monday May 20, 2013 @08:06AM (#5737155)
Exactly, there's too many if this than do thats in $().