resource / Front-End-Standards

Front-end development standards for Resource.
MIT License
23 stars 1 forks source link

Sizzle "bad" example #33

Closed mrbinky3000 closed 11 years ago

mrbinky3000 commented 11 years ago

https://github.com/LukeAskew/Front-End-Standards/blob/master/JavaScript/jQuery.md

The first example $('.sidebar', 'ul').hide() is used as a "bad" example.

It is really really bad, because it doesn't select anything. :-) I stuck it in a page and the jquery selector draws a blank.

LukeAskew commented 11 years ago

Oops. It is switched. Should read:

$('ul', '.sidebar').hide()

In all honesty, the performance hit will be negligible in 99% of the stuff we build; more wanting to bring consistency to how we write $ selectors.