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
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
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
640
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
Fluid Templating in TYPO3 14
s2b
0
130
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2k
AI巻き込み型コードレビューのススメ
nealle
0
130
CSC307 Lecture 04
javiergs
PRO
0
660
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
160
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
590
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
150
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
510
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Making Projects Easy
brettharned
120
6.6k
A Soul's Torment
seathinner
5
2.2k
Prompt Engineering for Job Search
mfonobong
0
160
GraphQLとの向き合い方2022年版
quramy
50
14k
Being A Developer After 40
akosma
91
590k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.6k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
730
What's in a price? How to price your products and services
michaelherold
247
13k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
A better future with KSS
kneath
240
18k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
440
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