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() clarification
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
430
SSH Can
oursky
1
250
HTTP/2
oursky
0
290
watchOS2
oursky
0
210
Common QA issues
oursky
0
150
Complex is better than complicated
oursky
0
230
Clean code again
oursky
3
310
KiriKiri x O2 x NVLMarker
oursky
0
160
Flux + React
oursky
1
330
Other Decks in Programming
See All in Programming
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
5
920
Zero Waste, Radical Magic, and Italian Graft – Quarkus Efficiency Secrets
hollycummins
0
230
使ってみよう Azure AI Document Intelligence
kosmosebi
2
310
Fast JSX: Don't clone props object #28768
yossydev
1
100
"config" ってなんだ? / What is "config"?
okashoi
0
240
Amazon SQSコンシューマー疎結合への旅 - 出張! #DevelopersIO IT技術ブログの中の人が語る勉強会 #3
quiver
0
270
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
170
Code Reviews
bkuhlmann
4
890
Node.js v22 で変わること
yosuke_furukawa
PRO
9
3.4k
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
7
930
Fragment Composition of GraphQL
quramy
7
1k
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
360
Featured
See All Featured
Facilitating Awesome Meetings
lara
42
5.6k
RailsConf 2023
tenderlove
4
540
Six Lessons from altMBA
skipperchong
21
3k
The Language of Interfaces
destraynor
151
23k
Building Applications with DynamoDB
mza
88
5.6k
Rails Girls Zürich Keynote
gr2m
91
13k
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
We Have a Design System, Now What?
morganepeng
43
6.8k
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
The Pragmatic Product Professional
lauravandoore
25
5.8k
Robots, Beer and Maslow
schacon
PRO
155
7.9k
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/