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 bind(), live(), delegate(), on() clarifi...
Search
Oursky Limited
March 19, 2012
Programming
2
110
jQuery bind(), live(), delegate(), on() clarification
Oursky Limited
March 19, 2012
Tweet
Share
More Decks by Oursky Limited
See All by Oursky Limited
UI Automation
oursky
1
440
SSH Can
oursky
1
270
HTTP/2
oursky
0
300
watchOS2
oursky
0
270
Common QA issues
oursky
0
170
Complex is better than complicated
oursky
0
250
Clean code again
oursky
3
330
KiriKiri x O2 x NVLMarker
oursky
0
180
Flux + React
oursky
1
340
Other Decks in Programming
See All in Programming
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.2k
初めてDefinitelyTypedにPRを出した話
syumai
0
420
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
距離関数を極める! / SESSIONS 2024
gam0022
0
290
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
CSC509 Lecture 12
javiergs
PRO
0
160
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
200
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.4k
C++でシェーダを書く
fadis
6
4.1k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Fireside Chat
paigeccino
34
3k
Writing Fast Ruby
sferik
627
61k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Why Our Code Smells
bkeepers
PRO
334
57k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Documentation Writing (for coders)
carmenintech
65
4.4k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Designing for humans not robots
tammielis
250
25k
What's in a price? How to price your products and services
michaelherold
243
12k
Gamification - CAS2011
davidbonilla
80
5k
Transcript
Oursky Weekly Presentation jQuery bind(), live(), delegate(), on() clarification
Web View... Starting with sample code.. HTML...
Simple Binding JS... Notes Most common binding Attaches the event
handler to every matched elements Doesn’t work for dynamic elements added later on (such as ajax)
Live() JS... Notes Similar syntax Binding still works when dynamic
elements added later on Attached the event handler to “document” once StopPropagation not working already because the event is propagated to the root to handle already Have performance issues
Delegate() JS... Notes Only bind to selected root element The
event still propagated from target element to selected root element, but it is much better than live()
On() bind(), live() and delegate() just become one line call
in jQuery 1.7, as well as their unbinding methods
Custom events? JS... Notes It also works on custom binding
events!
Credits Web Dev .NET - Differences Between jQuery .bind() vs
.live() vs .delegate() vs .on() http://www.elijahmanor.com/2012/02/differences-between-jquery-bind-vs-live.html jQuery on() http://api.jquery.com/on/