SlideShare ist ein Scribd-Unternehmen logo
1 von 22
BUILT IN FAIRFIELD COUNT Y:
FRONT END DEVELOPERS MEETUP
TUES. JUNE 11, 2013
JSON Part 2:
Working with Ajax
About Jeff Fox (@jfox015)
 16 year web development professional
 (Almost) entirely self taught
 Thorough front and back end experience
 Develops JavaScript based web apps that rely on JSON and
Ajax for data workflow
 Not to be confused with the former Connecticut News
weatherman (That’s Geoff Fox)
Overview
 JSON Review
 What is Ajax?
 Benefits
 Drawbacks?
 Ajax and JQuery
 Live Demo
JSON Review
JSON Highlights
 A lightweight text based data interchange format
 Use it to transfer JavaScript object data to and from a
remote data source
 Language independent
 Based on a subset of the JavaScript Programming
Language
 Easy to understand, manipulate and generate
Why use it?
 Straightforward syntax
 Easy to create and manipulate
 Can be parsed to a native JavaScript object using
JSON.parse()
 Supported by (most) major browsers and JavaScript
frameworks
 Built in support in most backend technologies
Onto AJAX…
…with a little history for good measure
What is Ajax?
 Ajax stands for “Asynchronous JavaScript and XML”
 JavaScript API for exchanging data with a web server and
returning the response to JavaScript
 You’re not stuck with only asynchronous operations
 You don’t have to use XML to use Ajax
Where did Ajax come from?
 Microsoft first added an XMLHTTP ActiveX control to Internet
Explorer 5 in 1999
 The Mozilla project next added the XMLHttpRequest object
with the same functionality to the Gecko layout engine
 Safari, Konqueror and Opera all followed suit implementing
the XMLHttpRequest object as well
 W3C issued a working draft specification for it in 2006
 IE 7 added support for XMLHttpRequest
First Usages
 Google wowed everyone when they made email cool in
2004 using Ajax in Gmail
 Then followed up with their equally
impressive Maps in 2005
And the crowd went wild!
Benefits of Ajax
Benefits of Ajax
 Improved user experience (no page refresh)
 Makes web (and mobile web) applications feel more like
native applications
 Faster than a full page refresh (targeted content and data
vs. complete load of all HTML, JS, CSS and image assets)
 Developers can write endpoints for specific user
operations instead of heavy, all-inclusive scripts
Drawbacks?
Drawbacks
 Ajax operations can sometimes be difficult to debug
 That’s why we love Firebug though, right?
 Poorly designed Ajax driven apps can create a confusing
or detrimental user experience
 Loss of addressability (Everything has the same URL)
Ajax and JQuery
Typical Ajax Functions in JQuery
 $.ajax({
type: "POST",
url: "somescript.php",
data: { “name”: “Jeff", “location”: “Norwalk" }
).done(function() { … });
 $.getJSON("somescript.php").done(function() { … });
 $.post ("somescript.php“, { “key”: “value” }
).done(function() { … });
Live Example
Dynamic App Demo
 JSON Driven App Dashboard
 All data loaded as JSON via Ajax calls using JQuery
 Display received data in UI
 No page refreshes
Questions?
Resources
 Demo source code on Github:
https://github.com/jfox015/BIFC-JSON-Dashboard
 XMLHttpRequest @ Wikipedia:
http://en.wikipedia.org/wiki/XMLHttpRequest
 Medialoot HTML 5 Template used in this demo:
http://medialoot.com/item/html5-admin-template/
JSON Part 2: Working with Ajax

Weitere ähnliche Inhalte

Was ist angesagt?

The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL Stack
Sashko Stubailo
 

Was ist angesagt? (20)

Real life cross-platform application development using Xamarin Forms - Frank ...
Real life cross-platform application development using Xamarin Forms - Frank ...Real life cross-platform application development using Xamarin Forms - Frank ...
Real life cross-platform application development using Xamarin Forms - Frank ...
 
Browser Developer Tools
Browser Developer ToolsBrowser Developer Tools
Browser Developer Tools
 
From rest api to graph ql a 10 year journey
From rest api to graph ql a 10 year journeyFrom rest api to graph ql a 10 year journey
From rest api to graph ql a 10 year journey
 
Single page application
Single page applicationSingle page application
Single page application
 
React introduction
React introductionReact introduction
React introduction
 
Building configurable applications for the web
Building configurable applications for the webBuilding configurable applications for the web
Building configurable applications for the web
 
RubyConf Taiwan 2016 - Large scale Rails applications
RubyConf Taiwan 2016 - Large scale Rails applicationsRubyConf Taiwan 2016 - Large scale Rails applications
RubyConf Taiwan 2016 - Large scale Rails applications
 
GraphQL IndyJS April 2016
GraphQL IndyJS April 2016GraphQL IndyJS April 2016
GraphQL IndyJS April 2016
 
Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4
 
«I knew there had to be a better way to build mobile app»​
«I knew there had to be a better way to build mobile app»​«I knew there had to be a better way to build mobile app»​
«I knew there had to be a better way to build mobile app»​
 
Single page application
Single page applicationSingle page application
Single page application
 
«Разрушаем Вавилонскую Башню WWW с помощью веб-компонент»​
«Разрушаем Вавилонскую Башню WWW с помощью веб-компонент»​«Разрушаем Вавилонскую Башню WWW с помощью веб-компонент»​
«Разрушаем Вавилонскую Башню WWW с помощью веб-компонент»​
 
RubyConf China 2015 - Rails off assets pipeline
RubyConf China 2015 - Rails off assets pipelineRubyConf China 2015 - Rails off assets pipeline
RubyConf China 2015 - Rails off assets pipeline
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL Stack
 
Visual resume
Visual resumeVisual resume
Visual resume
 
Static is just a cache
Static is just a cacheStatic is just a cache
Static is just a cache
 
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
 
Web-centric application architectures
Web-centric application architecturesWeb-centric application architectures
Web-centric application architectures
 
Xml usage in my work
Xml usage in my workXml usage in my work
Xml usage in my work
 
Modern SharePoint Development using Visual Studio Code
Modern SharePoint Development using Visual Studio CodeModern SharePoint Development using Visual Studio Code
Modern SharePoint Development using Visual Studio Code
 

Ähnlich wie JSON Part 2: Working with Ajax

Ajax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE EnvironmentAjax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE Environment
starchaser
 
4005-713 ` XML Architecture, Tools & Technique ` Presentation
4005-713 ` XML Architecture, Tools & Technique ` Presentation4005-713 ` XML Architecture, Tools & Technique ` Presentation
4005-713 ` XML Architecture, Tools & Technique ` Presentation
litcigar
 
Ajax: User Experience
Ajax: User ExperienceAjax: User Experience
Ajax: User Experience
petrov
 
Ajax Introduction Presentation
Ajax   Introduction   PresentationAjax   Introduction   Presentation
Ajax Introduction Presentation
thinkphp
 
Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat Client
Paul Klipp
 
UIT: Our Skills
UIT: Our SkillsUIT: Our Skills
UIT: Our Skills
uitpramati
 

Ähnlich wie JSON Part 2: Working with Ajax (20)

Ajax presentation
Ajax presentationAjax presentation
Ajax presentation
 
NetBeans Support for EcmaScript 6
NetBeans Support for EcmaScript 6NetBeans Support for EcmaScript 6
NetBeans Support for EcmaScript 6
 
Ajax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE EnvironmentAjax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE Environment
 
Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 
4005-713 ` XML Architecture, Tools & Technique ` Presentation
4005-713 ` XML Architecture, Tools & Technique ` Presentation4005-713 ` XML Architecture, Tools & Technique ` Presentation
4005-713 ` XML Architecture, Tools & Technique ` Presentation
 
Introduction to ajax
Introduction  to  ajaxIntroduction  to  ajax
Introduction to ajax
 
Ajax: User Experience
Ajax: User ExperienceAjax: User Experience
Ajax: User Experience
 
Ajax Introduction Presentation
Ajax   Introduction   PresentationAjax   Introduction   Presentation
Ajax Introduction Presentation
 
Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat Client
 
UIT: Our Skills
UIT: Our SkillsUIT: Our Skills
UIT: Our Skills
 
Angular jS Introduction by Google
Angular jS Introduction by GoogleAngular jS Introduction by Google
Angular jS Introduction by Google
 
Ajax
AjaxAjax
Ajax
 
RICH INTERNET APPLICATIONS - RIA Tools
RICH INTERNET APPLICATIONS - RIA ToolsRICH INTERNET APPLICATIONS - RIA Tools
RICH INTERNET APPLICATIONS - RIA Tools
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
 
Jake_Park_resume
Jake_Park_resumeJake_Park_resume
Jake_Park_resume
 
M Ramya
M RamyaM Ramya
M Ramya
 
INTRODUCTION.docx
INTRODUCTION.docxINTRODUCTION.docx
INTRODUCTION.docx
 
25250716 seminar-on-ajax text
25250716 seminar-on-ajax text25250716 seminar-on-ajax text
25250716 seminar-on-ajax text
 
RIA - Rich Internet Applications
RIA - Rich Internet ApplicationsRIA - Rich Internet Applications
RIA - Rich Internet Applications
 

Kürzlich hochgeladen

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
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
giselly40
 

Kürzlich hochgeladen (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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 Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
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
 

JSON Part 2: Working with Ajax

  • 1. BUILT IN FAIRFIELD COUNT Y: FRONT END DEVELOPERS MEETUP TUES. JUNE 11, 2013 JSON Part 2: Working with Ajax
  • 2. About Jeff Fox (@jfox015)  16 year web development professional  (Almost) entirely self taught  Thorough front and back end experience  Develops JavaScript based web apps that rely on JSON and Ajax for data workflow  Not to be confused with the former Connecticut News weatherman (That’s Geoff Fox)
  • 3. Overview  JSON Review  What is Ajax?  Benefits  Drawbacks?  Ajax and JQuery  Live Demo
  • 5. JSON Highlights  A lightweight text based data interchange format  Use it to transfer JavaScript object data to and from a remote data source  Language independent  Based on a subset of the JavaScript Programming Language  Easy to understand, manipulate and generate
  • 6. Why use it?  Straightforward syntax  Easy to create and manipulate  Can be parsed to a native JavaScript object using JSON.parse()  Supported by (most) major browsers and JavaScript frameworks  Built in support in most backend technologies
  • 7. Onto AJAX… …with a little history for good measure
  • 8. What is Ajax?  Ajax stands for “Asynchronous JavaScript and XML”  JavaScript API for exchanging data with a web server and returning the response to JavaScript  You’re not stuck with only asynchronous operations  You don’t have to use XML to use Ajax
  • 9. Where did Ajax come from?  Microsoft first added an XMLHTTP ActiveX control to Internet Explorer 5 in 1999  The Mozilla project next added the XMLHttpRequest object with the same functionality to the Gecko layout engine  Safari, Konqueror and Opera all followed suit implementing the XMLHttpRequest object as well  W3C issued a working draft specification for it in 2006  IE 7 added support for XMLHttpRequest
  • 10. First Usages  Google wowed everyone when they made email cool in 2004 using Ajax in Gmail  Then followed up with their equally impressive Maps in 2005
  • 11. And the crowd went wild!
  • 13. Benefits of Ajax  Improved user experience (no page refresh)  Makes web (and mobile web) applications feel more like native applications  Faster than a full page refresh (targeted content and data vs. complete load of all HTML, JS, CSS and image assets)  Developers can write endpoints for specific user operations instead of heavy, all-inclusive scripts
  • 15. Drawbacks  Ajax operations can sometimes be difficult to debug  That’s why we love Firebug though, right?  Poorly designed Ajax driven apps can create a confusing or detrimental user experience  Loss of addressability (Everything has the same URL)
  • 17. Typical Ajax Functions in JQuery  $.ajax({ type: "POST", url: "somescript.php", data: { “name”: “Jeff", “location”: “Norwalk" } ).done(function() { … });  $.getJSON("somescript.php").done(function() { … });  $.post ("somescript.php“, { “key”: “value” } ).done(function() { … });
  • 19. Dynamic App Demo  JSON Driven App Dashboard  All data loaded as JSON via Ajax calls using JQuery  Display received data in UI  No page refreshes
  • 21. Resources  Demo source code on Github: https://github.com/jfox015/BIFC-JSON-Dashboard  XMLHttpRequest @ Wikipedia: http://en.wikipedia.org/wiki/XMLHttpRequest  Medialoot HTML 5 Template used in this demo: http://medialoot.com/item/html5-admin-template/