Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
jQuery
Search
nctunba
March 21, 2012
Programming
630
8
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
jQuery
nctunba
March 21, 2012
More Decks by nctunba
See All by nctunba
被 Qt 快樂的玩弄
nctunba
2
420
被 Qt 快樂的玩弄 part 1
nctunba
1
310
Node - Express - Socket.io
nctunba
1
440
Python
nctunba
3
560
node
nctunba
9
50k
JS
nctunba
11
650
Other Decks in Programming
See All in Programming
自分的「カンファレンスの楽しみ方」
syumai
0
180
新卒PdEのリアル
ryu1013
0
160
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
800
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
620
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
330
Press start. Python's next generation.
willingc
PRO
3
300
My Marp Sample
sinoue0108
0
140
PyO3 で既存 Python 評価器を Rust core 化する ー wasm-bindgen でブラウザにも配るための設計
kdash
1
350
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
0
300
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
110
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
110
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
180
Featured
See All Featured
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Site-Speed That Sticks
csswizardry
13
1.5k
Bash Introduction
62gerente
615
220k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Technical Leadership for Architectural Decision Making
baasie
3
550
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
810
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
660
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Between Models and Reality
mayunak
4
440
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Transcript
jQuery
$
write less, do more
JavaScript Library
Client-side Scripting
Saves people's lifes since 2006
Does the dirty work for you
by “dirty work”, I mean W3C DOM
Document Object Model
Object Model for Documents
Object Model for HTML
HTML <=> DOM
HTML <=> DOM
HTML <=> DOM <=> JS
API between HTML & JS
W3C DOM
ugly & tedious
jQuery
jQuery Manipulation Attributes Effects Selectors Traversing Plugins Ajax Events
Install
None
<html> <head> <script src=”path/to/jquery”></script> </head> <body> </body> </html>
Hello World
DOM is a tree
|-> Document |-> <html> |-> <body> |-> <h1> |-> text
node |-> <p> |-> <a> |-> <br> |-> <a>
$('h1').text('hello world')
$('h1').text('hello world') Select and manipulate
$('h1').text('hello world') Select and manipulate
$ I am jQuery
$('h1') the Selector
.text('hello world') Set text
.text() Get text
var text = $('h1').text(); console.log(text);
$('h1') .text('hello') .fadeOut(); Chaining!
Selectors
Selects the nodes in the tree
Act just like CSS Selectors
$('h1') All h1 elements
$('p') All p elements
$('h1.banana') All h1 elements with class banana
$('h1#chuck') All h1 elements with id chuck
$('.banana') All elements with class banana
$('[type=”text”]') All elements with attribute type = text
Manipulations
Play with a node
CSS
How a node looks like
Traversing
Visit other nodes
Events
Nodes are responsive
$(...).someEvent(callback)
Ajax
Grabs you data