Hacker News new | ask | show | jobs
by octatone2 4779 days ago
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.
1 comments

And onDocumentReady handling :)

You can do this:

    $(function() { /* handle onDocLoad */ })
Exactly, there's too many if this than do thats in $().