SlideShare a Scribd company logo
AJAX Building faster dynamic websites - Asynchronous JavaScript and XML
Ajax Ajax is a  group  of web development methods used on the client-side to create interactive web applications. With Ajax, web applications can send data  to , and retrieve data  from , a server  asynchronously  (in the background) without interfering with the display and behavior of the existing page. Data are usually retrieved using the  XMLHttpRequest  object.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Advantages ,[object Object],[object Object],[object Object],[object Object],[object Object]
Disadvantages ,[object Object],[object Object],[object Object],[object Object]
Disadvantages ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
Synchronous ,[object Object],[object Object],[object Object],[object Object]
Asynchronous(99%) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Beginners fall into trap. Why? Rare situations  where it just doesn't make any sense at all  to allow your visitor to continue interacting with the web page  until a particular server side process completes. The only difference  when using asynchronous calls  is that you can actually set up multiple Ajax calls that overlap with a second call being made before the first has responded. This is where  asynchronous Ajax does become slightly more complicated  than synchronous Ajax because you need to make sure that  each Ajax request uses a separate Ajax object  rather than reusing the same object for all your Ajax requests
Two choices of passing the request ,[object Object],[object Object],[object Object],[object Object]
Passing request to server: Differences ,[object Object],[object Object],[object Object]
How to choose between GET & POST? ,[object Object],[object Object],[object Object]
How to choose between GET & POST? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Ajax jQuery syntax jQuery.ajax( url, [settings] )  Or jQuery.ajax( settings ) Url : A string containing the URL to which the  request is sent . Settings : A set of key/value pairs that  configure the Ajax request . All settings are  optional . A default can be set for any option with  $.ajaxSetup() .
Settings Accepts ( Map -depends on Datatype):  The content type sent in the request header that  tells the server what kind of response it will accept  in return. Async(Boolean-true):  By default, all requests are  sent asynchronously . If you need synchronous requests, set this option to false. Synchronous requests may  temporarily lock the browser . BeforeSend(jqXHR, settings)- Function A  pre-request callback function  that can be used to modify the  jqXHR object  before it is sent. Used to set custom headers, etc.
Settings Cache(Boolean-true, false for DataType 'script' and 'jsonp'):  If set to false, it will  force requested pages not to be cached by the browser . Setting cache to false also  appends a query string parameter, "_=[TIMESTAMP]" , to the URL. Complete(jqXHR, textStatus)-Function,Array A function to be called when the  request finishes . Two arguments: The  jqXHR object  and a string categorizing the  status of the request  ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). Contents(1.5) A map of string/regular-expression pairs that  determine how jQuery will parse the response , given its content type.
Settings ContentType(String-'application/x-www-form-urlencoded‘) When sending data to the server,  uses this content-type . Context(Object) This object will be made the context of all Ajax-related callbacks. Converters(Map) A map of  dataType-to-dataType converters . Each converter's value is a function that returns the transformed value of the response.
Settings CrossDomain(Boolean-false for same-domain requests, true for cross-domain requests) Set the value of crossDomain to true for,  server-side redirection to another domain . Data(Object) Data to be  sent to the server . It is converted to a  query string , if not already a string. It's appended to the url for GET-requests.  Key-value pairs . DataType(String-Intelligent Guess-xml, json, script, or html) The type of data that you're  expecting back from the server .
Settings Error(jqXHR, textStatus, errorThrown)- Function A function to be called if the  request fails . TextStatus-"timeout", "error", "abort", and "parsererror“ and ErrorThrown- for HTTP errors. "Not Found" or "Internal Server Error.“ Global(Boolean-true) Whether to  trigger global Ajax event handlers  for this request. Set to false to  prevent the global handlers  like ajaxStart or ajaxStop from being triggered. Headers(1.5) A map of  additional header key/value pairs  to send along with the request. This setting is set  before the beforeSend  function is called; therefore, any values in the headers setting can be  overwritten  from within the beforeSend function.
Settings IfModified(Boolean-false) Allow the  request to be successful only if the response has changed  since the last request. IsLocal(1.5) Allow the  current environment to be recognized as "local"  (e.g. the filesystem) Jsonp(String) Override the callback function  name in a jsonp request.
Settings JsonpCallback(String) Specify the  callback function name  for a JSONP request. MimeType(1.5) A mime type to  override the XHR  mime type. Password(String) and Username(String A password to be used in response to an  HTTP access authentication  request. ProcessData(Boolean-true) By default data is processed as QueryString. Any DOMDocument or non-processed data set it to false.
Settings ScriptCharset(String)   Only for requests with  "jsonp" or "script"  dataType and  "GET"  type. Forces the request to be  interpreted as a certain charset . StatusCode(1.5)   A map of numeric  HTTP codes and functions  to be called when the response has the corresponding code. Success(data, textStatus, jqXHR)   A function to be called if the  request succeeds . Timeout(Number)   Set a local timeout (in milliseconds) for the request.
Settings Type(String-GET)   The  type of request  to make ("POST" or "GET"). Url(String- The current page)   A string containing the URL  to which the request is sent . Xhr(Function-ActiveXObject)   Callback  for creating the XMLHttpRequest object. XhrFields(Map)   A map of fieldName-fieldValue pairs to set on the  native XHR object . Ex: Set  withCredentials  to true for  cross-domain requests  if needed
The jqXHR Object ,[object Object],[object Object],[object Object],[object Object],[object Object]
AJAX on Hands
Global Ajax Event Handlers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Global Ajax Event Handlers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Helper Functions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Low-Level Interface ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shorthand Methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shorthand Methods ,[object Object],[object Object],[object Object],[object Object]
No Queries? THANK YOU

More Related Content

What's hot

jQuery
jQueryjQuery
Javascript arrays
Javascript arraysJavascript arrays
Javascript arrays
Hassan Dar
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
Edureka!
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
Mohammed Arif
 
jQuery
jQueryjQuery
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
Joshua Long
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page ApplicationKMS Technology
 
Ajax presentation
Ajax presentationAjax presentation
Ajax presentation
engcs2008
 
React workshop
React workshopReact workshop
React workshop
Imran Sayed
 
Expressjs
ExpressjsExpressjs
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
Smithss25
 
Master page in Asp.net
Master page in Asp.netMaster page in Asp.net
Master page in Asp.net
RupinderjitKaur9
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
Dominic Arrojado
 
Database Connectivity in PHP
Database Connectivity in PHPDatabase Connectivity in PHP
Database Connectivity in PHP
Taha Malampatti
 
jQuery
jQueryjQuery
jQuery
Vishwa Mohan
 
JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)
WebStackAcademy
 
Reactjs
Reactjs Reactjs
Reactjs
Neha Sharma
 

What's hot (20)

jQuery
jQueryjQuery
jQuery
 
Javascript arrays
Javascript arraysJavascript arrays
Javascript arrays
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Ajax Presentation
Ajax PresentationAjax Presentation
Ajax Presentation
 
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
jQuery
jQueryjQuery
jQuery
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
 
Js ppt
Js pptJs ppt
Js ppt
 
Ajax presentation
Ajax presentationAjax presentation
Ajax presentation
 
React workshop
React workshopReact workshop
React workshop
 
Expressjs
ExpressjsExpressjs
Expressjs
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
 
Master page in Asp.net
Master page in Asp.netMaster page in Asp.net
Master page in Asp.net
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
Database Connectivity in PHP
Database Connectivity in PHPDatabase Connectivity in PHP
Database Connectivity in PHP
 
jQuery
jQueryjQuery
jQuery
 
JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)
 
Reactjs
Reactjs Reactjs
Reactjs
 

Viewers also liked

Jquery Ajax
Jquery AjaxJquery Ajax
Jquery Ajax
Anand Kumar Rajana
 
JavaScript JQUERY AJAX
JavaScript JQUERY AJAXJavaScript JQUERY AJAX
JavaScript JQUERY AJAX
Makarand Bhatambarekar
 
CSS Fundamentals: selectors and Properties
CSS Fundamentals: selectors and PropertiesCSS Fundamentals: selectors and Properties
CSS Fundamentals: selectors and Properties
Pedro Valente
 
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive Design
Zoe Gillenwater
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
Russ Weakley
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
Nir Elbaz
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
Ron Reiter
 

Viewers also liked (8)

Jquery Ajax
Jquery AjaxJquery Ajax
Jquery Ajax
 
JavaScript JQUERY AJAX
JavaScript JQUERY AJAXJavaScript JQUERY AJAX
JavaScript JQUERY AJAX
 
CSS Fundamentals: selectors and Properties
CSS Fundamentals: selectors and PropertiesCSS Fundamentals: selectors and Properties
CSS Fundamentals: selectors and Properties
 
Ajax and Jquery
Ajax and JqueryAjax and Jquery
Ajax and Jquery
 
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive Design
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
 

Similar to jQuery Ajax

Ajax
AjaxAjax
AJAX
AJAXAJAX
AJAXARJUN
 
Ajax Basics And Framework
Ajax Basics And FrameworkAjax Basics And Framework
Ajax Basics And Frameworkshivas
 
Using Ajax In Domino Web Applications
Using Ajax In Domino Web ApplicationsUsing Ajax In Domino Web Applications
Using Ajax In Domino Web Applicationsdominion
 
Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)
Adnan Sohail
 
Ajax and PHP
Ajax and PHPAjax and PHP
Ajax and PHP
John Coggeshall
 
AJAX
AJAXAJAX
25250716 seminar-on-ajax text
25250716 seminar-on-ajax text25250716 seminar-on-ajax text
25250716 seminar-on-ajax text
Kamleshh Chandnani
 
M Ramya
M RamyaM Ramya
Overview of AJAX
Overview of AJAXOverview of AJAX
Overview of AJAX
Roshith S Pai
 
Introduction about-ajax-framework
Introduction about-ajax-frameworkIntroduction about-ajax-framework
Introduction about-ajax-framework
Sakthi Bro
 
Ajax
AjaxAjax
Ajax
AjaxAjax

Similar to jQuery Ajax (20)

Mashup
MashupMashup
Mashup
 
Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 
AJAX
AJAXAJAX
AJAX
 
Ajax Basics And Framework
Ajax Basics And FrameworkAjax Basics And Framework
Ajax Basics And Framework
 
Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 
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
 
Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)
 
Ajax and PHP
Ajax and PHPAjax and PHP
Ajax and PHP
 
AJAX
AJAXAJAX
AJAX
 
25250716 seminar-on-ajax text
25250716 seminar-on-ajax text25250716 seminar-on-ajax text
25250716 seminar-on-ajax text
 
Ajax
AjaxAjax
Ajax
 
M Ramya
M RamyaM Ramya
M Ramya
 
Overview of AJAX
Overview of AJAXOverview of AJAX
Overview of AJAX
 
Ajax.ppt
Ajax.pptAjax.ppt
Ajax.ppt
 
Introduction about-ajax-framework
Introduction about-ajax-frameworkIntroduction about-ajax-framework
Introduction about-ajax-framework
 
Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 

More from Anand Kumar Rajana

Interface Vs Abstact
Interface Vs AbstactInterface Vs Abstact
Interface Vs Abstact
Anand Kumar Rajana
 
Anand's Leadership Assessment
Anand's Leadership AssessmentAnand's Leadership Assessment
Anand's Leadership Assessment
Anand Kumar Rajana
 
Sql Server 2012 Installation..
Sql Server 2012 Installation..Sql Server 2012 Installation..
Sql Server 2012 Installation..Anand Kumar Rajana
 
Json
JsonJson
J Query Introduction And JQuery Selectors
J Query Introduction And JQuery SelectorsJ Query Introduction And JQuery Selectors
J Query Introduction And JQuery Selectors
Anand Kumar Rajana
 

More from Anand Kumar Rajana (12)

Interface Vs Abstact
Interface Vs AbstactInterface Vs Abstact
Interface Vs Abstact
 
Anand's Leadership Assessment
Anand's Leadership AssessmentAnand's Leadership Assessment
Anand's Leadership Assessment
 
Understanding linq
Understanding linqUnderstanding linq
Understanding linq
 
Rhino Mocks
Rhino MocksRhino Mocks
Rhino Mocks
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
The Seven Pillars Of Asp.Net
The Seven Pillars Of Asp.NetThe Seven Pillars Of Asp.Net
The Seven Pillars Of Asp.Net
 
What Do You Mean By NUnit
What Do You Mean By NUnitWhat Do You Mean By NUnit
What Do You Mean By NUnit
 
Wcf
WcfWcf
Wcf
 
Sql Server 2012 Installation..
Sql Server 2012 Installation..Sql Server 2012 Installation..
Sql Server 2012 Installation..
 
Json
JsonJson
Json
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
J Query Introduction And JQuery Selectors
J Query Introduction And JQuery SelectorsJ Query Introduction And JQuery Selectors
J Query Introduction And JQuery Selectors
 

Recently uploaded

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 

Recently uploaded (20)

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 

jQuery Ajax

  • 1. AJAX Building faster dynamic websites - Asynchronous JavaScript and XML
  • 2. Ajax Ajax is a group of web development methods used on the client-side to create interactive web applications. With Ajax, web applications can send data to , and retrieve data from , a server asynchronously (in the background) without interfering with the display and behavior of the existing page. Data are usually retrieved using the XMLHttpRequest object.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Beginners fall into trap. Why? Rare situations where it just doesn't make any sense at all to allow your visitor to continue interacting with the web page until a particular server side process completes. The only difference when using asynchronous calls is that you can actually set up multiple Ajax calls that overlap with a second call being made before the first has responded. This is where asynchronous Ajax does become slightly more complicated than synchronous Ajax because you need to make sure that each Ajax request uses a separate Ajax object rather than reusing the same object for all your Ajax requests
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. Ajax jQuery syntax jQuery.ajax( url, [settings] ) Or jQuery.ajax( settings ) Url : A string containing the URL to which the request is sent . Settings : A set of key/value pairs that configure the Ajax request . All settings are optional . A default can be set for any option with $.ajaxSetup() .
  • 16. Settings Accepts ( Map -depends on Datatype): The content type sent in the request header that tells the server what kind of response it will accept in return. Async(Boolean-true): By default, all requests are sent asynchronously . If you need synchronous requests, set this option to false. Synchronous requests may temporarily lock the browser . BeforeSend(jqXHR, settings)- Function A pre-request callback function that can be used to modify the jqXHR object before it is sent. Used to set custom headers, etc.
  • 17. Settings Cache(Boolean-true, false for DataType 'script' and 'jsonp'): If set to false, it will force requested pages not to be cached by the browser . Setting cache to false also appends a query string parameter, "_=[TIMESTAMP]" , to the URL. Complete(jqXHR, textStatus)-Function,Array A function to be called when the request finishes . Two arguments: The jqXHR object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). Contents(1.5) A map of string/regular-expression pairs that determine how jQuery will parse the response , given its content type.
  • 18. Settings ContentType(String-'application/x-www-form-urlencoded‘) When sending data to the server, uses this content-type . Context(Object) This object will be made the context of all Ajax-related callbacks. Converters(Map) A map of dataType-to-dataType converters . Each converter's value is a function that returns the transformed value of the response.
  • 19. Settings CrossDomain(Boolean-false for same-domain requests, true for cross-domain requests) Set the value of crossDomain to true for, server-side redirection to another domain . Data(Object) Data to be sent to the server . It is converted to a query string , if not already a string. It's appended to the url for GET-requests. Key-value pairs . DataType(String-Intelligent Guess-xml, json, script, or html) The type of data that you're expecting back from the server .
  • 20. Settings Error(jqXHR, textStatus, errorThrown)- Function A function to be called if the request fails . TextStatus-"timeout", "error", "abort", and "parsererror“ and ErrorThrown- for HTTP errors. "Not Found" or "Internal Server Error.“ Global(Boolean-true) Whether to trigger global Ajax event handlers for this request. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. Headers(1.5) A map of additional header key/value pairs to send along with the request. This setting is set before the beforeSend function is called; therefore, any values in the headers setting can be overwritten from within the beforeSend function.
  • 21. Settings IfModified(Boolean-false) Allow the request to be successful only if the response has changed since the last request. IsLocal(1.5) Allow the current environment to be recognized as "local" (e.g. the filesystem) Jsonp(String) Override the callback function name in a jsonp request.
  • 22. Settings JsonpCallback(String) Specify the callback function name for a JSONP request. MimeType(1.5) A mime type to override the XHR mime type. Password(String) and Username(String A password to be used in response to an HTTP access authentication request. ProcessData(Boolean-true) By default data is processed as QueryString. Any DOMDocument or non-processed data set it to false.
  • 23. Settings ScriptCharset(String) Only for requests with "jsonp" or "script" dataType and "GET" type. Forces the request to be interpreted as a certain charset . StatusCode(1.5) A map of numeric HTTP codes and functions to be called when the response has the corresponding code. Success(data, textStatus, jqXHR) A function to be called if the request succeeds . Timeout(Number) Set a local timeout (in milliseconds) for the request.
  • 24. Settings Type(String-GET) The type of request to make ("POST" or "GET"). Url(String- The current page) A string containing the URL to which the request is sent . Xhr(Function-ActiveXObject) Callback for creating the XMLHttpRequest object. XhrFields(Map) A map of fieldName-fieldValue pairs to set on the native XHR object . Ex: Set withCredentials to true for cross-domain requests if needed
  • 25.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.