Javascript is NOT the enemy. You can find peace.
Why jQuery?
powerful, wide support, works for me (after initial period of grumpy old man whining)
History
- 3 years old
- high compatibility
- free
- minified, gziped or full fat
- available on Google CDN
What does it do?
- finds stuff
- changes stuff
- loads stuff
- and more stuff
Signs that you may be looking at jQuery
- $ is jQuery
- lots and lots and lots of stuff chained together because everything returns itself
Selectors
- find soemthing
- follows CSS rules
- Basic – $(“#someId”) $(“.someClass”) $(“p”)
- $(“#parent p”) –> all paragraphs under #parent
- $(“something:not(somethingelse)”)
- also has ^ $ for beginning and end
- $(‘a[href*=cnn]‘) –> all links to anything containing cnn
- $(‘a[href$=pdf]‘) –> all links whtat end in pdf
- $(‘#favThings > li:even and
dd - :eq
- contains
- form related (checked, selected, en/disabled)
- next, prev, parent, children, and siblings
- filter (custom JS code)
Manipulation
- adding, removing classes
- setting, getting attributes
- prepending and appending
- changing contents
Events
- what you expect (click, change, etc)
- special ones (hover, toggle)
- $(document).ready
Effects
- tick me off
- “will my client want to see this 50 times?”
- hiding/showing
- fading
- bouncing
- http://docs.jquery.com/effects
Ajax
- load
- get (has length restriction)
- post
- getJSON
- getScript
Plugins
- over 2,400
- wide range of areas: ui, form, widgets, etc
- quality also covers a wide range
Favorites
- Validate
- ThickBox
- jqGrid
- jQuery Select
jQuery+CF
Helpful
- still the glue
- native JSON format
- returnFormat
- XML generation
Not So Helpful
- onRequest (EVIL++) fixed in CF9
- whitepsace
- debugging
Post a Comment