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
490
SSH Can
oursky
1
310
HTTP/2
oursky
0
340
watchOS2
oursky
0
320
Common QA issues
oursky
0
200
Complex is better than complicated
oursky
0
280
Clean code again
oursky
3
360
KiriKiri x O2 x NVLMarker
oursky
0
230
Flux + React
oursky
1
380
Other Decks in Programming
See All in Programming
Migration to Signals, Resource API, and NgRx Signal Store
manfredsteyer
PRO
0
120
あなたとKaigi on Rails / Kaigi on Rails + You
shimoju
0
190
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
290
alien-signals と自作 OSS で実現する フレームワーク非依存な ロジック共通化の探求 / Exploring Framework-Agnostic Logic Sharing with alien-signals and Custom OSS
aoseyuu
2
700
他言語経験者が Golangci-lint を最初のコーディングメンターにした話 / How Golangci-lint Became My First Coding Mentor: A Story from a Polyglot Programmer
uma31
0
430
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
4
16k
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
3
850
iOSでSVG画像を扱う
kishikawakatsumi
0
170
ALL CODE BASE ARE BELONG TO STUDY
uzulla
28
6.7k
Introduce Hono CLI
yusukebe
6
3.1k
マンガアプリViewerの大画面対応を考える
kk__777
0
280
CSC305 Lecture 10
javiergs
PRO
0
270
Featured
See All Featured
The Language of Interfaces
destraynor
162
25k
Product Roadmaps are Hard
iamctodd
PRO
55
11k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
Balancing Empowerment & Direction
lara
5
700
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Agile that works and the tools we love
rasmusluckow
331
21k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
Gamification - CAS2011
davidbonilla
81
5.5k
How GitHub (no longer) Works
holman
315
140k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
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/