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
9
610
jQuery
nctunba
March 21, 2012
Tweet
Share
More Decks by nctunba
See All by nctunba
被 Qt 快樂的玩弄
nctunba
2
400
被 Qt 快樂的玩弄 part 1
nctunba
1
290
Node - Express - Socket.io
nctunba
1
420
Python
nctunba
3
520
node
nctunba
9
50k
JS
nctunba
11
640
Other Decks in Programming
See All in Programming
TDD 実践ミニトーク
contour_gara
1
290
Swift Updates - Learn Languages 2025
koher
2
470
ぬるぬる動かせ! Riveでアニメーション実装🐾
kno3a87
1
200
開発チーム・開発組織の設計改善スキルの向上
masuda220
PRO
19
11k
RDoc meets YARD
okuramasafumi
4
170
AI時代のUIはどこへ行く?
yusukebe
16
8.7k
OSS開発者という働き方
andpad
5
1.7k
ユーザーも開発者も悩ませない TV アプリ開発 ~Compose の内部実装から学ぶフォーカス制御~
taked137
0
140
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
3
290
実用的なGOCACHEPROG実装をするために / golang.tokyo #40
mazrean
1
250
CloudflareのChat Agent Starter Kitで簡単!AIチャットボット構築
syumai
2
460
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
6
2.3k
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
9.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
580
Building Applications with DynamoDB
mza
96
6.6k
Agile that works and the tools we love
rasmusluckow
330
21k
Designing for humans not robots
tammielis
253
25k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
Speed Design
sergeychernyshev
32
1.1k
It's Worth the Effort
3n
187
28k
A Modern Web Designer's Workflow
chriscoyier
696
190k
What's in a price? How to price your products and services
michaelherold
246
12k
Context Engineering - Making Every Token Count
addyosmani
1
27
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