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
480
SSH Can
oursky
1
300
HTTP/2
oursky
0
330
watchOS2
oursky
0
310
Common QA issues
oursky
0
190
Complex is better than complicated
oursky
0
270
Clean code again
oursky
3
360
KiriKiri x O2 x NVLMarker
oursky
0
220
Flux + React
oursky
1
370
Other Decks in Programming
See All in Programming
dbt民主化とLLMによる開発ブースト ~ AI Readyな分析サイクルを目指して ~
yoshyum
3
370
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
560
“いい感じ“な定量評価を求めて - Four Keysとアウトカムの間の探求 -
nealle
1
3.5k
「Cursor/Devin全社導入の理想と現実」のその後
saitoryc
0
700
Goで作る、開発・CI環境
sin392
0
190
AIと”コードの評価関数”を共有する / Share the "code evaluation function" with AI
euglena1215
1
110
ruby.wasmで多人数リアルタイム通信ゲームを作ろう
lnit
3
360
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
320
Code as Context 〜 1にコードで 2にリンタ 34がなくて 5にルール? 〜
yodakeisuke
0
120
WebViewの現在地 - SwiftUI時代のWebKit - / The Current State Of WebView
marcy731
0
110
git worktree × Claude Code × MCP ~生成AI時代の並列開発フロー~
hisuzuya
1
520
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
50
32k
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
17
950
Faster Mobile Websites
deanohume
307
31k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
YesSQL, Process and Tooling at Scale
rocio
173
14k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.4k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Making Projects Easy
brettharned
116
6.3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
810
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
940
A better future with KSS
kneath
239
17k
The Pragmatic Product Professional
lauravandoore
35
6.7k
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/