1. introduction
to
jQuery
Garrett Johnson // CharlotteJS // 8-19-2010
Friday, August 20, 2010
2. Me?
Jr. Web Developer at Red Ventures
Student
I will program in just about anything.
Started this joint! (with a lot of help from Nathan and
Aaron)
Friday, August 20, 2010
3. jQuery
Seriously?
"jQuery is a fast and concise JavaScript Library that
simplifies HTML document traversing, event handling,
animating, and Ajax interactions for rapid web
development."
Friday, August 20, 2010
5. Lets Get It
A quick tour with some stops on the way. Feel free to
stop and start discussion.
Friday, August 20, 2010
6. document.ready?
just an event.*
gets triggered once the DOM is parsed/loaded.
use as much as you want.*
just put your <script></script> prior to </body> or right
below the desired element.
DOM is ready at this point.
portability?*
Friday, August 20, 2010
10. selectors
cache selectors
selector context
find()
exact on the left, general on the right.
avoid pure class or node selectors
keep it simple!
Friday, August 20, 2010
12. wait... what the $
$ === jQuery
$() is a factory.*
returns “array like” collection of “jQuery” objects.
not just css selectors.
raw elements.*
html.*
Friday, August 20, 2010
18. traversing / manipulation
once you found it. do something.
tons more features for traversing and manipulation.
the docs are awesome.
Friday, August 20, 2010
19. events
binding proxy shorthands*
custom live delegate
namespaces delegation* more
Friday, August 20, 2010
20. events
find something. bind it.
$(‘.foo’).bind(‘click’, fn);
$(‘.foo’).click(fn);
$(‘.foo’).live(‘click’, fn);
$(‘#bar’).delegate(‘.foo’, ‘click’, fn)*
Friday, August 20, 2010