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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
nctunba
March 21, 2012
Programming
630
8
Share
jQuery
nctunba
March 21, 2012
More Decks by nctunba
See All by nctunba
被 Qt 快樂的玩弄
nctunba
2
410
被 Qt 快樂的玩弄 part 1
nctunba
1
300
Node - Express - Socket.io
nctunba
1
430
Python
nctunba
3
540
node
nctunba
9
50k
JS
nctunba
11
650
Other Decks in Programming
See All in Programming
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
120
なぜあなたのコードには「コシ」がないのか?〜AI時代に問う、最後まで美味しい設計と戦略〜 #phpconkagawa / phpconkagawa2026
shogogg
0
140
GitHubCopilotCLIをはじめよう.pdf
htkym
0
320
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
180
Building on Bluesky's AT Protocol with Ruby
mackuba
0
100
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
640
PHPer、Cloudflare に引っ越す
suguruooki
1
140
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1.1k
Vibe NLP for Applied NLP
inesmontani
PRO
0
600
JOAI2026 1st solution - heron0519 -
heron0519
0
180
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
2.8k
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
330
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
2
1k
Between Models and Reality
mayunak
3
280
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
110
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
New Earth Scene 8
popppiees
3
2.2k
SEO for Brand Visibility & Recognition
aleyda
0
4.5k
Rails Girls Zürich Keynote
gr2m
96
14k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
We Have a Design System, Now What?
morganepeng
55
8.1k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
290
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