j
Query
Created by John Resig in 2006
Most popular JavaScript library in use today
MIT License
JQuery exposes itself to the global object:
window.jQuery = window.$ = jQuery;
Getting started
Yerevan
Vanadzor
Gyumri
Using CSS Selectors
$( '#myID' ); // select an element by ID
$( 'li' ); // select all LIs
$( 'ul li' ); // select LIs that are in ULs
$( '.person' ); // select elements by class
$( '[data-foo="bar"]' ); // select by attribute
Using CSS Selectors
$( element ); // wrap an element
$( [element1, element2] ); // wrap an array of elements
$( '.foo', element ); // select by class only nodes under 'element'
$( '.foo', $(element) ); // select by class only nodes under the given jquery object
html, text, attr, css, val
Add/remove css classes
hello world
Chaining
Finding elements relative to a selection
hello
world
Creating new elements
Removing elements
If we lose the Teghut forest, we are in
LOTS of
trouble
Events (on/off)
HELLO!!!
Unhook events
GOOD BYE!!!
Events
click
keydown
keypress
keyup
mouseover
mouseout
mouseenter
mouseleave
scroll
focus
blur
resize
JQuery docs
Animations
Run
JQuery docs
$.ajax
$.getJson (see also $.get $.post)
Plugin template
Credits
Some examples inspired by http://jqfundamentals.com
Rouben Meschian
rmeschian@gmail.com