Hacker News new | past | comments | ask | show | jobs | submit login
Commonly Confused Bits Of jQuery (smashingmagazine.com)
43 points by pinksoda on Aug 11, 2010 | hide | past | favorite | 4 comments



This article is pretty ok, but some examples given struck me as a little weird.

Example for "live()": var newDiv = document.createElement('div'); newDiv.appendChild(document.createTextNode('hello, world!')); [...] document.body.appendChild(newDiv);

jQuery simplifies DOM elements creation and insertion: var newDiv = $('<div>hello, world!</div>').appendTo('body');

It is kind of funny to see plain old DOM createElement/createTextNode in article about intricacies of jQuery. All of DOM elements creation in article uses non-jQuery mechanisms. Only one commenter mentioned that jQuery support easy elements creation/insertion. That way, article promotes somewhat half-baked usage of jQuery.


I'm kind of surprised something better than JQuery hasn't caught on. JQuery syntax makes me cringe.


Really? I've actually kinda grown to love it. What about it makes you dislike it so much?


I'm really surprised you don't like it. It might sound strange but the first thing that got me hooked on jQuery was the syntax, and then the selector mechanism. It feels very clean, looks readable and is quite concise, especially compared to the plain old javascript that I used to write.

What is it you don't like? I'm not saying you're wrong for not liking it btw, each to their own! I'm just curious.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: