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
8
620
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
530
node
nctunba
9
50k
JS
nctunba
11
650
Other Decks in Programming
See All in Programming
MUSUBIXとは
nahisaho
0
130
CSC307 Lecture 05
javiergs
PRO
0
500
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
510
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
110
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
190
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
「ブロックテーマでは再現できない」は本当か?
inc2734
0
780
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
0
930
CSC307 Lecture 04
javiergs
PRO
0
660
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
660
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
AI時代の認知負荷との向き合い方
optfit
0
150
Featured
See All Featured
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
140
ラッコキーワード サービス紹介資料
rakko
1
2.2M
Claude Code のすすめ
schroneko
67
210k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.9k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
380
Speed Design
sergeychernyshev
33
1.5k
エンジニアに許された特別な時間の終わり
watany
106
230k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
Accessibility Awareness
sabderemane
0
49
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