SlideShare uma empresa Scribd logo
1 de 16
Prepared by:
 Ahmed EL-Harouny
Senior Software Engineer
1.        Handling Events
     1.    Binding To Events
     2.    Event Object
     3.    Binding Shortcuts
     4.    Manually Trigger Events
     5.    Keyboard Events
     6.    Unbind Events
     7.    The Live() function
2.        Ajax
     1.    load() – the simplest
     2.    jQuery.ajax() – the giant
     3.    Json and Jsonp
     4.    Twitter demo!
3.        Build a plugin Demo
Bind() function: attach a handler to an event for the elements.




Multiple Handlers

When an event reaches an element, all handlers bound to that event type for
the element are fired. If there are multiple handlers registered, they will
always execute in the order in which they were bound. After all handlers have
executed, the event continues along the normal event propagation path.
event object: an object that contains information and functionality related to
the current event is passed to all event handlers:
Most DOM events exists as functions for short
• click()
• change()
• mousedown(), mouseenter(), mouseleave(), mousemove() …etc
• ready()
• scroll()
trigger() function: Execute all handlers and behaviors attached to the
matched elements for the given event type.




Shortcut functions can also be used for triggering events:
keyup(): The keyup event is sent to an element when the user releases a key
on the keyboard.




keydown (): The keydown event is sent to an element when the user first
presses a key on the keyboard.

Note: keyboard events are only triggered on elements that have focus.
unbind() function: Remove a previously-attached event handler from the
elements.
live() function: Attach an event handler for all elements which match the
 current selector, now and in the future.




Note: #thirdBtn don’t exist on the page yet.
load() function: Load data from the server and place the returned HTML
into the matched element.




Also takes those optional parameters:
[, data] [, complete(responseText, textStatus, XMLHttpRequest)]
jQuery.ajax() function: Perform an asynchronous HTTP (Ajax) request.
Reference: http://api.jquery.com/jQuery.ajax/
   Json
    JavaScript Object Notation, is a lightweight text-based open
    standard designed for human-readable data interchange.

    Despite its relationship to JavaScript, it is language-
    independent, with parsers available for many languages.
Jason Format:
   Jsonp
    JSONP or "JSON with padding" is a complement to the base
    JSON data format. It provides a method to request data from
    a server in a different domain, something prohibited by
    typical web browsers because of the same origin policy.
Demo
Demo
http://harouny.wordpress.com/2012/06/06/make-your-first-
jquery-plugin-in-2-minutes/

Mais conteúdo relacionado

Mais procurados

React js use contexts and useContext hook
React js use contexts and useContext hookReact js use contexts and useContext hook
React js use contexts and useContext hookPiyush Jamwal
 
Part 6 filter using table record in vb.net
Part 6 filter using table record in vb.netPart 6 filter using table record in vb.net
Part 6 filter using table record in vb.netGirija Muscut
 
Part 7 navigating through recordset in vb.net
Part 7 navigating through recordset in vb.netPart 7 navigating through recordset in vb.net
Part 7 navigating through recordset in vb.netGirija Muscut
 
Javascript dom event
Javascript dom eventJavascript dom event
Javascript dom eventBunlong Van
 
iOS Keychain by 흰, 민디
iOS Keychain by 흰, 민디iOS Keychain by 흰, 민디
iOS Keychain by 흰, 민디MINJICHO20
 
Realm database
Realm databaseRealm database
Realm databaseVoneat Pen
 
Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012Droidcon Eastern Europe
 
Dot net technology
Dot net technologyDot net technology
Dot net technologyMilanMiyani1
 
Timothy N. Tsvetkov, Rails 3.1
Timothy N. Tsvetkov, Rails 3.1Timothy N. Tsvetkov, Rails 3.1
Timothy N. Tsvetkov, Rails 3.1Evil Martians
 
Vuex: X factor for Vue
Vuex: X factor for VueVuex: X factor for Vue
Vuex: X factor for VueAkansh Gulati
 
Asynchronous and event-driven Grails applications
Asynchronous and event-driven Grails applicationsAsynchronous and event-driven Grails applications
Asynchronous and event-driven Grails applicationsAlvaro Sanchez-Mariscal
 
Infinum Android Talks #02 - EventBus
Infinum Android Talks #02 - EventBusInfinum Android Talks #02 - EventBus
Infinum Android Talks #02 - EventBusInfinum
 
JS Fest 2018. Martin Chaov. SSE vs WebSockets vs Long Polling
JS Fest 2018. Martin Chaov. SSE vs WebSockets vs Long PollingJS Fest 2018. Martin Chaov. SSE vs WebSockets vs Long Polling
JS Fest 2018. Martin Chaov. SSE vs WebSockets vs Long PollingJSFestUA
 
Modern Web Apps Development 101
Modern Web Apps Development 101Modern Web Apps Development 101
Modern Web Apps Development 101Stanimir Todorov
 

Mais procurados (20)

React js use contexts and useContext hook
React js use contexts and useContext hookReact js use contexts and useContext hook
React js use contexts and useContext hook
 
Part 6 filter using table record in vb.net
Part 6 filter using table record in vb.netPart 6 filter using table record in vb.net
Part 6 filter using table record in vb.net
 
Part 7 navigating through recordset in vb.net
Part 7 navigating through recordset in vb.netPart 7 navigating through recordset in vb.net
Part 7 navigating through recordset in vb.net
 
Javascript dom event
Javascript dom eventJavascript dom event
Javascript dom event
 
React.js+Redux Workshops
React.js+Redux WorkshopsReact.js+Redux Workshops
React.js+Redux Workshops
 
Html5 events
Html5 eventsHtml5 events
Html5 events
 
iOS Keychain by 흰, 민디
iOS Keychain by 흰, 민디iOS Keychain by 흰, 민디
iOS Keychain by 흰, 민디
 
Examplecode
ExamplecodeExamplecode
Examplecode
 
Realm database
Realm databaseRealm database
Realm database
 
Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012
 
Dot net technology
Dot net technologyDot net technology
Dot net technology
 
Timothy N. Tsvetkov, Rails 3.1
Timothy N. Tsvetkov, Rails 3.1Timothy N. Tsvetkov, Rails 3.1
Timothy N. Tsvetkov, Rails 3.1
 
Vuex: X factor for Vue
Vuex: X factor for VueVuex: X factor for Vue
Vuex: X factor for Vue
 
Guava’s Event Bus
Guava’s Event BusGuava’s Event Bus
Guava’s Event Bus
 
Asynchronous and event-driven Grails applications
Asynchronous and event-driven Grails applicationsAsynchronous and event-driven Grails applications
Asynchronous and event-driven Grails applications
 
Infinum Android Talks #02 - EventBus
Infinum Android Talks #02 - EventBusInfinum Android Talks #02 - EventBus
Infinum Android Talks #02 - EventBus
 
GreenRobot-Eventbus
GreenRobot-EventbusGreenRobot-Eventbus
GreenRobot-Eventbus
 
Ext Js Events
Ext Js EventsExt Js Events
Ext Js Events
 
JS Fest 2018. Martin Chaov. SSE vs WebSockets vs Long Polling
JS Fest 2018. Martin Chaov. SSE vs WebSockets vs Long PollingJS Fest 2018. Martin Chaov. SSE vs WebSockets vs Long Polling
JS Fest 2018. Martin Chaov. SSE vs WebSockets vs Long Polling
 
Modern Web Apps Development 101
Modern Web Apps Development 101Modern Web Apps Development 101
Modern Web Apps Development 101
 

Semelhante a Advanced Jquery

Event handling
Event handlingEvent handling
Event handlingswapnac12
 
Introj Query Pt2
Introj Query Pt2Introj Query Pt2
Introj Query Pt2kshyju
 
13. session 13 introduction to dhtml
13. session 13   introduction to dhtml13. session 13   introduction to dhtml
13. session 13 introduction to dhtmlPhúc Đỗ
 
Javascript #8 : événements
Javascript #8 : événementsJavascript #8 : événements
Javascript #8 : événementsJean Michel
 
event handling new.ppt
event handling new.pptevent handling new.ppt
event handling new.pptusama537223
 
Event Handling in Java
Event Handling in JavaEvent Handling in Java
Event Handling in JavaAyesha Kanwal
 
event-handling.pptx
event-handling.pptxevent-handling.pptx
event-handling.pptxusvirat1805
 
JavaScript_Events.pptx
JavaScript_Events.pptxJavaScript_Events.pptx
JavaScript_Events.pptxYagna15
 
Event Handling in JAVA
Event Handling in JAVAEvent Handling in JAVA
Event Handling in JAVASrajan Shukla
 
Advance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handlingAdvance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handlingPayal Dungarwal
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptWalid Ashraf
 
Event+driven+programming key+features
Event+driven+programming key+featuresEvent+driven+programming key+features
Event+driven+programming key+featuresFaisal Aziz
 
Chap - 2 - Event Handling.pptx
Chap - 2 - Event Handling.pptxChap - 2 - Event Handling.pptx
Chap - 2 - Event Handling.pptxTadeseBeyene
 
Lesson 07 Actions and Commands in WPF
Lesson 07 Actions and Commands in WPFLesson 07 Actions and Commands in WPF
Lesson 07 Actions and Commands in WPFQuang Nguyễn Bá
 

Semelhante a Advanced Jquery (20)

J Query Presentation of David
J Query Presentation of DavidJ Query Presentation of David
J Query Presentation of David
 
Event handling
Event handlingEvent handling
Event handling
 
Introj Query Pt2
Introj Query Pt2Introj Query Pt2
Introj Query Pt2
 
13. session 13 introduction to dhtml
13. session 13   introduction to dhtml13. session 13   introduction to dhtml
13. session 13 introduction to dhtml
 
Javascript #8 : événements
Javascript #8 : événementsJavascript #8 : événements
Javascript #8 : événements
 
event handling new.ppt
event handling new.pptevent handling new.ppt
event handling new.ppt
 
Event Handling in Java
Event Handling in JavaEvent Handling in Java
Event Handling in Java
 
Javascript Browser Events.pdf
Javascript Browser Events.pdfJavascript Browser Events.pdf
Javascript Browser Events.pdf
 
event-handling.pptx
event-handling.pptxevent-handling.pptx
event-handling.pptx
 
JavaScript_Events.pptx
JavaScript_Events.pptxJavaScript_Events.pptx
JavaScript_Events.pptx
 
Event Handling in JAVA
Event Handling in JAVAEvent Handling in JAVA
Event Handling in JAVA
 
What is Event
What is EventWhat is Event
What is Event
 
Advance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handlingAdvance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handling
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
 
09events
09events09events
09events
 
Event+driven+programming key+features
Event+driven+programming key+featuresEvent+driven+programming key+features
Event+driven+programming key+features
 
16 18
16 1816 18
16 18
 
JAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
JAVA PROGRAMMING- GUI Programming with Swing - The Swing ButtonsJAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
JAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
 
Chap - 2 - Event Handling.pptx
Chap - 2 - Event Handling.pptxChap - 2 - Event Handling.pptx
Chap - 2 - Event Handling.pptx
 
Lesson 07 Actions and Commands in WPF
Lesson 07 Actions and Commands in WPFLesson 07 Actions and Commands in WPF
Lesson 07 Actions and Commands in WPF
 

Mais de Ahmed Elharouny

Deep dive into azure durable functions
Deep dive into azure durable functionsDeep dive into azure durable functions
Deep dive into azure durable functionsAhmed Elharouny
 
Applying microservices principles to front end
Applying microservices principles to front endApplying microservices principles to front end
Applying microservices principles to front endAhmed Elharouny
 
Introduction to require js
Introduction to require jsIntroduction to require js
Introduction to require jsAhmed Elharouny
 
Building share point apps with angularjs
Building share point apps with angularjsBuilding share point apps with angularjs
Building share point apps with angularjsAhmed Elharouny
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJsAhmed Elharouny
 

Mais de Ahmed Elharouny (7)

Deep dive into azure durable functions
Deep dive into azure durable functionsDeep dive into azure durable functions
Deep dive into azure durable functions
 
Applying microservices principles to front end
Applying microservices principles to front endApplying microservices principles to front end
Applying microservices principles to front end
 
NoSQL, which way to go?
NoSQL, which way to go?NoSQL, which way to go?
NoSQL, which way to go?
 
Introduction to require js
Introduction to require jsIntroduction to require js
Introduction to require js
 
Building share point apps with angularjs
Building share point apps with angularjsBuilding share point apps with angularjs
Building share point apps with angularjs
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
 
Design patterns
Design patternsDesign patterns
Design patterns
 

Último

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Advanced Jquery

  • 1. Prepared by: Ahmed EL-Harouny Senior Software Engineer
  • 2. 1. Handling Events 1. Binding To Events 2. Event Object 3. Binding Shortcuts 4. Manually Trigger Events 5. Keyboard Events 6. Unbind Events 7. The Live() function 2. Ajax 1. load() – the simplest 2. jQuery.ajax() – the giant 3. Json and Jsonp 4. Twitter demo! 3. Build a plugin Demo
  • 3. Bind() function: attach a handler to an event for the elements. Multiple Handlers When an event reaches an element, all handlers bound to that event type for the element are fired. If there are multiple handlers registered, they will always execute in the order in which they were bound. After all handlers have executed, the event continues along the normal event propagation path.
  • 4. event object: an object that contains information and functionality related to the current event is passed to all event handlers:
  • 5. Most DOM events exists as functions for short • click() • change() • mousedown(), mouseenter(), mouseleave(), mousemove() …etc • ready() • scroll()
  • 6. trigger() function: Execute all handlers and behaviors attached to the matched elements for the given event type. Shortcut functions can also be used for triggering events:
  • 7. keyup(): The keyup event is sent to an element when the user releases a key on the keyboard. keydown (): The keydown event is sent to an element when the user first presses a key on the keyboard. Note: keyboard events are only triggered on elements that have focus.
  • 8. unbind() function: Remove a previously-attached event handler from the elements.
  • 9. live() function: Attach an event handler for all elements which match the current selector, now and in the future. Note: #thirdBtn don’t exist on the page yet.
  • 10. load() function: Load data from the server and place the returned HTML into the matched element. Also takes those optional parameters: [, data] [, complete(responseText, textStatus, XMLHttpRequest)]
  • 11. jQuery.ajax() function: Perform an asynchronous HTTP (Ajax) request. Reference: http://api.jquery.com/jQuery.ajax/
  • 12. Json JavaScript Object Notation, is a lightweight text-based open standard designed for human-readable data interchange. Despite its relationship to JavaScript, it is language- independent, with parsers available for many languages.
  • 14. Jsonp JSONP or "JSON with padding" is a complement to the base JSON data format. It provides a method to request data from a server in a different domain, something prohibited by typical web browsers because of the same origin policy.
  • 15. Demo