SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Asynchronize with jQuery Kevin Griffin
Developer for Antech Systems Chesapeake, VA Microsoft MVP – Client App Dev ASPInsider Leader of Hampton Roads .NET Users Group About Me
What is AJAX? Basic AJAX Implementation AJAX Shortcuts Global Handlers Design Considerations Agenda
Buzzword Asynchronous JavaScript and Xml Allows us to load or post data from the server without having to do post back. AJAX?
Asynchronous  Don’t block the current thread No defined execution time Start a call, and designate a callback method for when the call returns. Designing AJAX Applications
FireBug http://getfirebug.com/ Fiddler http://www.fiddler2.com/ AJAX Toolkit Psych! Tools for an AJAX Developer
Low level interface for making AJAX calls. Prototype: $.ajax(settings) jQuery.ajax()
url Url that jQuery should use for making the request. dataType The type of data we’re expecting from the response. Xml, JSON, Script, Html success Function to call if the AJAX call succeeds. error Function to call if the AJAX call fails. complete Function to call when the AJAX call returns.  Success or Failure. Basic Settings
Demo Basic use of $.ajax()
Because developers are lazy. $.get() $.getJSON() $.getScript() $.post() $.load() FAILS SILENTLY! Shortcuts
Demo Let’s take a shortcut
Keep track of AJAX events globally in your applications. $(element).ajaxComplete() $(element).ajaxError() $(element).ajaxSend() $(element).ajaxStart() $(element).ajaxStop() $(element).ajaxSuccess() Global Handlers
Demo	 Implementing Global Event Handlers
Let the user know something is happening Progress indicators Loading dialogs Handle errors gracefully Either local or global handlers Plan for worst case scenarios Dial up, hotel wireless SEO Back Button Design Considerations
Demo Putting It All Together
Email: kevin@kevgriffin.com Twitter: 1kevgriff http://www.kevgriffin.com Contact Me

Weitere ähnliche Inhalte

Was ist angesagt?

Architecting single-page front-end apps
Architecting single-page front-end appsArchitecting single-page front-end apps
Architecting single-page front-end apps
Zohar Arad
 
Slideshare - Magento Imagine - Do You Queue
Slideshare - Magento Imagine - Do You QueueSlideshare - Magento Imagine - Do You Queue
Slideshare - Magento Imagine - Do You Queue
10n Software, LLC
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
KMS Technology
 

Was ist angesagt? (20)

Better End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorBetter End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using Protractor
 
Sharing the pain using Protractor
Sharing the pain using ProtractorSharing the pain using Protractor
Sharing the pain using Protractor
 
Protractor end-to-end testing framework for angular js
Protractor   end-to-end testing framework for angular jsProtractor   end-to-end testing framework for angular js
Protractor end-to-end testing framework for angular js
 
Heuristics to scale your framework
Heuristics to scale your frameworkHeuristics to scale your framework
Heuristics to scale your framework
 
Integration and Acceptance Testing
Integration and Acceptance TestingIntegration and Acceptance Testing
Integration and Acceptance Testing
 
Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David Torroija
 
Architecting single-page front-end apps
Architecting single-page front-end appsArchitecting single-page front-end apps
Architecting single-page front-end apps
 
Protractor training
Protractor trainingProtractor training
Protractor training
 
Cypress - Best Practices
Cypress - Best PracticesCypress - Best Practices
Cypress - Best Practices
 
Mock Server Using WireMock
Mock Server Using WireMockMock Server Using WireMock
Mock Server Using WireMock
 
Front-End Testing: Demystified
Front-End Testing: DemystifiedFront-End Testing: Demystified
Front-End Testing: Demystified
 
Nightwatch at Tilt
Nightwatch at TiltNightwatch at Tilt
Nightwatch at Tilt
 
Slideshare - Magento Imagine - Do You Queue
Slideshare - Magento Imagine - Do You QueueSlideshare - Magento Imagine - Do You Queue
Slideshare - Magento Imagine - Do You Queue
 
Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)
 
Making Watir and Cucumber an efficient tool for Web UI Automation
Making Watir and Cucumber an efficient tool for Web UI AutomationMaking Watir and Cucumber an efficient tool for Web UI Automation
Making Watir and Cucumber an efficient tool for Web UI Automation
 
Cucumber ppt
Cucumber pptCucumber ppt
Cucumber ppt
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
 
Nightwatch JS for End to End Tests
Nightwatch JS for End to End TestsNightwatch JS for End to End Tests
Nightwatch JS for End to End Tests
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
 
Advanced Jasmine
Advanced JasmineAdvanced Jasmine
Advanced Jasmine
 

Andere mochten auch

raytheon annual reports 2005
raytheon annual reports 2005raytheon annual reports 2005
raytheon annual reports 2005
finance12
 
international paper Q3 2003 10-Q
international paper 	 Q3 2003 10-Qinternational paper 	 Q3 2003 10-Q
international paper Q3 2003 10-Q
finance12
 
Jenpowerpointetec442
Jenpowerpointetec442Jenpowerpointetec442
Jenpowerpointetec442
asatojen
 
emerson electricl Q1 2009 Earnings Presentation
emerson electricl Q1 2009 Earnings Presentationemerson electricl Q1 2009 Earnings Presentation
emerson electricl Q1 2009 Earnings Presentation
finance12
 
emerson electricl Proxy Statement for 2009 Annual Shareholders Meeting
emerson electricl Proxy Statement for 2009 Annual Shareholders Meeting  emerson electricl Proxy Statement for 2009 Annual Shareholders Meeting
emerson electricl Proxy Statement for 2009 Annual Shareholders Meeting
finance12
 
Macy’s Union Square
Macy’s Union SquareMacy’s Union Square
Macy’s Union Square
Karl Klemmick
 
Portsurf - Web Content Management Experts
Portsurf - Web Content Management ExpertsPortsurf - Web Content Management Experts
Portsurf - Web Content Management Experts
G4S Conference
 
A Safe Environment
A Safe Environment A Safe Environment
A Safe Environment
Ianharrison
 

Andere mochten auch (20)

raytheon annual reports 2005
raytheon annual reports 2005raytheon annual reports 2005
raytheon annual reports 2005
 
international paper Q3 2003 10-Q
international paper 	 Q3 2003 10-Qinternational paper 	 Q3 2003 10-Q
international paper Q3 2003 10-Q
 
Jenpowerpointetec442
Jenpowerpointetec442Jenpowerpointetec442
Jenpowerpointetec442
 
Dream Works
Dream WorksDream Works
Dream Works
 
emerson electricl Q1 2009 Earnings Presentation
emerson electricl Q1 2009 Earnings Presentationemerson electricl Q1 2009 Earnings Presentation
emerson electricl Q1 2009 Earnings Presentation
 
Social Commerce - Innovate 11
Social Commerce - Innovate 11Social Commerce - Innovate 11
Social Commerce - Innovate 11
 
Converting trial users to paying customers
Converting trial users to paying customersConverting trial users to paying customers
Converting trial users to paying customers
 
Linked In
Linked InLinked In
Linked In
 
How to make money from paid social
How to make money from paid socialHow to make money from paid social
How to make money from paid social
 
emerson electricl Proxy Statement for 2009 Annual Shareholders Meeting
emerson electricl Proxy Statement for 2009 Annual Shareholders Meeting  emerson electricl Proxy Statement for 2009 Annual Shareholders Meeting
emerson electricl Proxy Statement for 2009 Annual Shareholders Meeting
 
启示录 Ii
启示录 Ii启示录 Ii
启示录 Ii
 
Macy’s Union Square
Macy’s Union SquareMacy’s Union Square
Macy’s Union Square
 
Slideshow - 3
Slideshow - 3Slideshow - 3
Slideshow - 3
 
Portsurf - Web Content Management Experts
Portsurf - Web Content Management ExpertsPortsurf - Web Content Management Experts
Portsurf - Web Content Management Experts
 
Crocodiles
CrocodilesCrocodiles
Crocodiles
 
A Safe Environment
A Safe Environment A Safe Environment
A Safe Environment
 
Using Numbers
Using NumbersUsing Numbers
Using Numbers
 
Social Media Workshop Stichting Infix Uden
Social Media Workshop Stichting Infix UdenSocial Media Workshop Stichting Infix Uden
Social Media Workshop Stichting Infix Uden
 
Ideatoons
IdeatoonsIdeatoons
Ideatoons
 
Staying Competitive in 2010
Staying Competitive in 2010Staying Competitive in 2010
Staying Competitive in 2010
 

Ähnlich wie Async

Using Ajax In Domino Web Applications
Using Ajax In Domino Web ApplicationsUsing Ajax In Domino Web Applications
Using Ajax In Domino Web Applications
dominion
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
Chui-Wen Chiu
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web development
alice yang
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)
Hamed Hatami
 

Ähnlich wie Async (20)

Using Ajax In Domino Web Applications
Using Ajax In Domino Web ApplicationsUsing Ajax In Domino Web Applications
Using Ajax In Domino Web Applications
 
Ajax
AjaxAjax
Ajax
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
 
Ajax
AjaxAjax
Ajax
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
 
Building Applications Using Ajax
Building Applications Using AjaxBuilding Applications Using Ajax
Building Applications Using Ajax
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web development
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)
 
"Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native ""Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native "
 
Ajax Presentation
Ajax PresentationAjax Presentation
Ajax Presentation
 
Sanjeev ghai 12
Sanjeev ghai 12Sanjeev ghai 12
Sanjeev ghai 12
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 
Javascript-heavy Salesforce Applications
Javascript-heavy Salesforce ApplicationsJavascript-heavy Salesforce Applications
Javascript-heavy Salesforce Applications
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015
 
Walther Ajax4
Walther Ajax4Walther Ajax4
Walther Ajax4
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 
TY.BSc.IT Java QB U4
TY.BSc.IT Java QB U4TY.BSc.IT Java QB U4
TY.BSc.IT Java QB U4
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScript
 
JavaScript Unit Testing
JavaScript Unit TestingJavaScript Unit Testing
JavaScript Unit Testing
 
Ajax
AjaxAjax
Ajax
 

Mehr von Kevin Griffin

Mehr von Kevin Griffin (7)

Building Real Time Web Applications with SignalR (NoVA Code Camp 2015)
Building Real Time Web Applications with SignalR (NoVA Code Camp 2015)Building Real Time Web Applications with SignalR (NoVA Code Camp 2015)
Building Real Time Web Applications with SignalR (NoVA Code Camp 2015)
 
Codemash - Building Custom node.js Modules
Codemash - Building Custom node.js ModulesCodemash - Building Custom node.js Modules
Codemash - Building Custom node.js Modules
 
ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High Gear
ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High GearASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High Gear
ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High Gear
 
Robust Web APIs with node.js and Express
Robust Web APIs with node.js and ExpressRobust Web APIs with node.js and Express
Robust Web APIs with node.js and Express
 
Building node.js Modules
Building node.js ModulesBuilding node.js Modules
Building node.js Modules
 
ASP.NET MVC From The Ground Up
ASP.NET MVC From The Ground UpASP.NET MVC From The Ground Up
ASP.NET MVC From The Ground Up
 
jQuery From the Ground Up
jQuery From the Ground UpjQuery From the Ground Up
jQuery From the Ground Up
 

Async

  • 1. Asynchronize with jQuery Kevin Griffin
  • 2. Developer for Antech Systems Chesapeake, VA Microsoft MVP – Client App Dev ASPInsider Leader of Hampton Roads .NET Users Group About Me
  • 3. What is AJAX? Basic AJAX Implementation AJAX Shortcuts Global Handlers Design Considerations Agenda
  • 4. Buzzword Asynchronous JavaScript and Xml Allows us to load or post data from the server without having to do post back. AJAX?
  • 5. Asynchronous Don’t block the current thread No defined execution time Start a call, and designate a callback method for when the call returns. Designing AJAX Applications
  • 6. FireBug http://getfirebug.com/ Fiddler http://www.fiddler2.com/ AJAX Toolkit Psych! Tools for an AJAX Developer
  • 7. Low level interface for making AJAX calls. Prototype: $.ajax(settings) jQuery.ajax()
  • 8. url Url that jQuery should use for making the request. dataType The type of data we’re expecting from the response. Xml, JSON, Script, Html success Function to call if the AJAX call succeeds. error Function to call if the AJAX call fails. complete Function to call when the AJAX call returns. Success or Failure. Basic Settings
  • 9. Demo Basic use of $.ajax()
  • 10. Because developers are lazy. $.get() $.getJSON() $.getScript() $.post() $.load() FAILS SILENTLY! Shortcuts
  • 11. Demo Let’s take a shortcut
  • 12. Keep track of AJAX events globally in your applications. $(element).ajaxComplete() $(element).ajaxError() $(element).ajaxSend() $(element).ajaxStart() $(element).ajaxStop() $(element).ajaxSuccess() Global Handlers
  • 13. Demo Implementing Global Event Handlers
  • 14. Let the user know something is happening Progress indicators Loading dialogs Handle errors gracefully Either local or global handlers Plan for worst case scenarios Dial up, hotel wireless SEO Back Button Design Considerations
  • 15. Demo Putting It All Together
  • 16. Email: kevin@kevgriffin.com Twitter: 1kevgriff http://www.kevgriffin.com Contact Me