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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
310
Node - Express - Socket.io
nctunba
1
440
Python
nctunba
3
540
node
nctunba
9
50k
JS
nctunba
11
650
Other Decks in Programming
See All in Programming
AIとRubyの静的型付け
ukin0k0
0
510
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
410
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
110
Inside Stream API
skrb
1
570
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
460
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
430
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
1.3k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
260
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
2.9k
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
12
3.4k
AIエージェントの隔離技術の徹底比較
kawayu
0
450
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.2k
Featured
See All Featured
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
810
WCS-LA-2024
lcolladotor
0
610
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
RailsConf 2023
tenderlove
30
1.5k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.3k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Paper Plane (Part 1)
katiecoart
PRO
0
8.2k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
400
Building Flexible Design Systems
yeseniaperezcruz
330
40k
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