SlideShare a Scribd company logo
1 of 20
Download to read offline
Brief Introduction
Request to Response




                      Image from:
                      http://tinyurl.com/ajaxFlow
What should you know?
•Must be familiar with JavaScript.
•Any server side scripting language such as PHP.
Ajax Definition
• Ajax doesn't exist
• Ajax = Asynchronous JavaScript + XML
         In simple terms:
         It is a technique that allows the client to
      retrieve more data from the server without
      reloading the whole page
Fundamental
• Ajax comprises of three key components

                  } The DOM
   •CSS
   •(X)HTML
   •JavaScript         Document Object Model




                                           Image from:
                                           http://tinyurl.com/domTree
How to?
• Initialize the request
• Configure the connection
• Tell it, what to do when? (on state changes)
• Send the request
How to: Initializing the request
• ourAjaxObject =  new XMLHttpRequest();
• XMLHttpRequest: DOM API that can be used by web browser scripting languages
to transfer XML & other text data between a web server & a browser. - wikipedia

function getAjaxObject()
 { try {return new XMLHttpRequest(); } catch (err)
    { try {return new ActiveXObject(quot;Msxml2.XMLHTTPquot;); } catch (err)
         { try{ return new ActiveXObject(quot;Microsoft.XMLHTTPquot;); } catch (err)
             {return false;}
          }
    }
  }
• ourAjaxObject = getAjaxObject()
How to: Configure the connection
•The Ajax Workflow
    •What request method to use GET/POST
    •Where to go
    •Whether or not to go there asynchronously
•ajaxObject = getAjaxObject()
    •ourAjaxObject.open(method, url, true);
    •ourAjaxObject.open(method, url, false);
•URL:
    •url = ‘./getData.php’
    •parameters = ‘name=aman&place=pune&contact=mail@amanjain.com’
    •If(method=‘GET’){url = url+”?”+parameters }
How to: Overview
• function getAjaxObject()
 { try {return new XMLHttpRequest(); } catch (err)
     { try {return new ActiveXObject(quot;Msxml2.XMLHTTPquot;); } catch (err)
          { try{ return new ActiveXObject(quot;Microsoft.XMLHTTPquot;); } catch (err)
               {return false;}
           }
     }
  }
• ourAjaxObject = getAjaxObject()
•If(ourAjaxObject != false){
     method = “GET”;
     url = “./getData.php”;
     parameters = ‘name=aman&place=pune&contact=mail@amanjain.com’;
     If(method==“GET”){url = url+”?”+parameters; parameters=null; }
     ourAjaxObject.open(method, url, true);   }
How to: Tell it, what to do when? -part I
•onreadystatechange is a event handler for an event that fires at every
state change
•Possible readyState values are:
    •0 = uninitialized (unsent)
    •1 = opened
    •2 = headers received
    •3 = loading
    •4 = complete
•ourAjaxObject.onreadystatechange = callMe ;
•ourAjaxObject.send(parameters);
     i.e. parameters will be null if method is GET
Backend: Replying with plain text
<?php
   $name =    $_GET[‘name’];
   $place =   $_GET[‘place’];
   $contact = $_GET[‘contact’];

     echo “hi! $name. Nice to meet you at $place will mail
        you the further details at $contact.”;
?>
 
Backend: Replying XML
<?php
   $name =       $_GET[‘name’];
   $place =      $_GET[‘place’];
   $contact =    $_GET[‘contact’];
   header('Content-Type: text/xml'); //setting the header
   echo ‘<?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>’;
   echo quot;n<root>”;
   echo quot;nt<name>$name</name>”;
   echo quot;nt<place>$place</place>”;
   echo quot;nt<contact>$contact</contact>”;
   echo quot;n</root>”;
?>
How to: Tell it, what to do when? -part II
•function callMe()
 {
    if(ourAjaxObject.readyState == 4 )
    {
         alert(“we are receiving the data”);
         dataReceived = ourAjaxObject.responseText //for plain text, JSON
         // OR dataReceived = ourAjaxObject.responseXML, for XML
    }
 }
Properties & Description of XMLHttpRequest
Methods & Description of XMLHttpRequest
METHOD                                DESCRIPTION
abort()                                        Stops the current request
getAllResponseHeaders()                        Returns all headers (name and value) as a string
getResponseHeader(quot;<name>quot;)    Returns the value of the specified header
Open(method,url,true/false)      Opens a connection and retrieves response
                                               from the specified URL.
send(content)                                  Transmits request
setRequestHeader(quot;<name>quot;, quot;<value>quot;)                      Assigns values to the specified header
 
J avascript Libraries (e.g. jQuery)
jQuery is a lightweight JavaScript library that emphasizes interaction
between JavaScript and HTML. –wikipedia


Method:
<script type=quot;text/javascriptquot; src=quot;/path/to/jQuery.jsquot;></script>
dataReceived = $.ajax({
        type:quot;POSTquot;
        url:quot;./getData.phpquot;,
        data:quot;name=aman&place=pune&contact=mail@amanjain.comquot;,
        async: false }).responseText; // OR responseXML
Question ?
Wanna ping me ?
          My blog: http://blog.amanjain.com
           My email: mail@amanjain.com
           My Twitter handle :@amanjain
           (http://twitter.com/amanjain)

 Download this doc: http://amanjain.com/docs/ajax.pdf

                   Most Important
          Learn something new everyday at:
                http://PHPCamp.net
Thanks !

More Related Content

What's hot

Introduction tomongodb
Introduction tomongodbIntroduction tomongodb
Introduction tomongodb
Lee Theobald
 
Grails Simple Login
Grails Simple LoginGrails Simple Login
Grails Simple Login
moniguna
 

What's hot (20)

Ajax Technology
Ajax TechnologyAjax Technology
Ajax Technology
 
Introduction tomongodb
Introduction tomongodbIntroduction tomongodb
Introduction tomongodb
 
Android dev 3
Android dev 3Android dev 3
Android dev 3
 
Html server control - ASP. NET with c#
Html server control - ASP. NET with c#Html server control - ASP. NET with c#
Html server control - ASP. NET with c#
 
Thymeleaf Introduction
Thymeleaf IntroductionThymeleaf Introduction
Thymeleaf Introduction
 
Introduction to thymeleaf
Introduction to thymeleafIntroduction to thymeleaf
Introduction to thymeleaf
 
Grails Simple Login
Grails Simple LoginGrails Simple Login
Grails Simple Login
 
RSpec
RSpecRSpec
RSpec
 
Java script
Java scriptJava script
Java script
 
Rails is not just Ruby
Rails is not just RubyRails is not just Ruby
Rails is not just Ruby
 
React state managmenet with Redux
React state managmenet with ReduxReact state managmenet with Redux
React state managmenet with Redux
 
React JS and Redux
React JS and ReduxReact JS and Redux
React JS and Redux
 
Excellent
ExcellentExcellent
Excellent
 
Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming  Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming
 
React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux Introduction
 
HTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LAB
HTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LABHTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LAB
HTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LAB
 
React и redux
React и reduxReact и redux
React и redux
 
Automated testing for client-side - Adam Klein, 500 Tech
Automated testing for client-side - Adam Klein, 500 TechAutomated testing for client-side - Adam Klein, 500 Tech
Automated testing for client-side - Adam Klein, 500 Tech
 
symfony & jQuery (phpDay)
symfony & jQuery (phpDay)symfony & jQuery (phpDay)
symfony & jQuery (phpDay)
 
Ajax3
Ajax3Ajax3
Ajax3
 

Viewers also liked

Boom town
Boom townBoom town
Boom town
msnancy
 
North East Health CIO Network, Mark Thomas, Chair of the North East Health CI...
North East Health CIO Network, Mark Thomas, Chair of the North East Health CI...North East Health CIO Network, Mark Thomas, Chair of the North East Health CI...
North East Health CIO Network, Mark Thomas, Chair of the North East Health CI...
mfolkard
 
FEM DE REPORTERS - ELS VIDEOJOCS
FEM DE REPORTERS - ELS VIDEOJOCSFEM DE REPORTERS - ELS VIDEOJOCS
FEM DE REPORTERS - ELS VIDEOJOCS
scabarro
 
Després de l’eso
Després de l’esoDesprés de l’eso
Després de l’eso
scabarro
 
guangdongtiger is a cheater?
guangdongtiger is a cheater?guangdongtiger is a cheater?
guangdongtiger is a cheater?
Tony Liu
 
Efectes encadenats
Efectes encadenatsEfectes encadenats
Efectes encadenats
scabarro
 
Assertivitat
AssertivitatAssertivitat
Assertivitat
scabarro
 
Després de l’eso
Després de l’esoDesprés de l’eso
Després de l’eso
scabarro
 

Viewers also liked (20)

Case NITROQUIMICA
Case NITROQUIMICACase NITROQUIMICA
Case NITROQUIMICA
 
น่ารักDot
น่ารักDotน่ารักDot
น่ารักDot
 
Flaws
FlawsFlaws
Flaws
 
My science
My scienceMy science
My science
 
Fala Sodexofinal Carla2009
Fala Sodexofinal Carla2009Fala Sodexofinal Carla2009
Fala Sodexofinal Carla2009
 
Boom town
Boom townBoom town
Boom town
 
North East Health CIO Network, Mark Thomas, Chair of the North East Health CI...
North East Health CIO Network, Mark Thomas, Chair of the North East Health CI...North East Health CIO Network, Mark Thomas, Chair of the North East Health CI...
North East Health CIO Network, Mark Thomas, Chair of the North East Health CI...
 
ど根性駆動型コミュニティ開発
ど根性駆動型コミュニティ開発ど根性駆動型コミュニティ開発
ど根性駆動型コミュニティ開発
 
FEM DE REPORTERS - ELS VIDEOJOCS
FEM DE REPORTERS - ELS VIDEOJOCSFEM DE REPORTERS - ELS VIDEOJOCS
FEM DE REPORTERS - ELS VIDEOJOCS
 
自分のコミュニティを始めてみませんか?
自分のコミュニティを始めてみませんか?自分のコミュニティを始めてみませんか?
自分のコミュニティを始めてみませんか?
 
Research Remix
Research RemixResearch Remix
Research Remix
 
Proyecto_etwinning Conoced nuestra ciudad y nosotros la vuestra
Proyecto_etwinning Conoced nuestra ciudad y nosotros la vuestraProyecto_etwinning Conoced nuestra ciudad y nosotros la vuestra
Proyecto_etwinning Conoced nuestra ciudad y nosotros la vuestra
 
Després de l’eso
Després de l’esoDesprés de l’eso
Després de l’eso
 
guangdongtiger is a cheater?
guangdongtiger is a cheater?guangdongtiger is a cheater?
guangdongtiger is a cheater?
 
Efectes encadenats
Efectes encadenatsEfectes encadenats
Efectes encadenats
 
Assertivitat
AssertivitatAssertivitat
Assertivitat
 
Openoffice Portable In 2008conference
Openoffice Portable In 2008conferenceOpenoffice Portable In 2008conference
Openoffice Portable In 2008conference
 
Després de l’eso
Després de l’esoDesprés de l’eso
Després de l’eso
 
(日本人一人で)米国企業で働くために必要な3つのこと〜渡米後1ヶ月編〜
(日本人一人で)米国企業で働くために必要な3つのこと〜渡米後1ヶ月編〜(日本人一人で)米国企業で働くために必要な3つのこと〜渡米後1ヶ月編〜
(日本人一人で)米国企業で働くために必要な3つのこと〜渡米後1ヶ月編〜
 
Pere
PerePere
Pere
 

Similar to Ajax

Jscript Fundamentals
Jscript FundamentalsJscript Fundamentals
Jscript Fundamentals
rspaike
 
Ajax World Comet Talk
Ajax World Comet TalkAjax World Comet Talk
Ajax World Comet Talk
rajivmordani
 
Ajax Fundamentals Web Applications
Ajax Fundamentals Web ApplicationsAjax Fundamentals Web Applications
Ajax Fundamentals Web Applications
dominion
 

Similar to Ajax (20)

How to make Ajax work for you
How to make Ajax work for youHow to make Ajax work for you
How to make Ajax work for you
 
Os Pruett
Os PruettOs Pruett
Os Pruett
 
Pascarello_Investigating JavaScript and Ajax Security
Pascarello_Investigating JavaScript and Ajax SecurityPascarello_Investigating JavaScript and Ajax Security
Pascarello_Investigating JavaScript and Ajax Security
 
Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 
The Real Time Web with XMPP
The Real Time Web with XMPPThe Real Time Web with XMPP
The Real Time Web with XMPP
 
Ajax Ppt
Ajax PptAjax Ppt
Ajax Ppt
 
Ajax ppt
Ajax pptAjax ppt
Ajax ppt
 
Jsf Ajax
Jsf AjaxJsf Ajax
Jsf Ajax
 
Ajax - a quick introduction
Ajax - a quick introductionAjax - a quick introduction
Ajax - a quick introduction
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop Notes
 
AJAX.pptx
AJAX.pptxAJAX.pptx
AJAX.pptx
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
 
Jscript Fundamentals
Jscript FundamentalsJscript Fundamentals
Jscript Fundamentals
 
Ajax.ppt
Ajax.pptAjax.ppt
Ajax.ppt
 
Ajax Introduction
Ajax IntroductionAjax Introduction
Ajax Introduction
 
Ajax World Comet Talk
Ajax World Comet TalkAjax World Comet Talk
Ajax World Comet Talk
 
Ajax Fundamentals Web Applications
Ajax Fundamentals Web ApplicationsAjax Fundamentals Web Applications
Ajax Fundamentals Web Applications
 
Implementing Ajax In ColdFusion 7
Implementing Ajax In ColdFusion 7Implementing Ajax In ColdFusion 7
Implementing Ajax In ColdFusion 7
 
Core Java tutorial at Unit Nexus
Core Java tutorial at Unit NexusCore Java tutorial at Unit Nexus
Core Java tutorial at Unit Nexus
 

Recently uploaded

call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morcall Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
vikas rana
 
the Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentationthe Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentation
brynpueblos04
 
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
Cara Menggugurkan Kandungan 087776558899
 

Recently uploaded (14)

2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
 
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morcall Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
 
WOMEN EMPOWERMENT women empowerment.pptx
WOMEN EMPOWERMENT women empowerment.pptxWOMEN EMPOWERMENT women empowerment.pptx
WOMEN EMPOWERMENT women empowerment.pptx
 
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
 
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
 
Pokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy TheoryPokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy Theory
 
the Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentationthe Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentation
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
 
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
 
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
 
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
 
LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdf
 
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
 

Ajax

  • 1.
  • 3. Request to Response Image from: http://tinyurl.com/ajaxFlow
  • 4. What should you know? •Must be familiar with JavaScript. •Any server side scripting language such as PHP.
  • 5. Ajax Definition • Ajax doesn't exist • Ajax = Asynchronous JavaScript + XML In simple terms: It is a technique that allows the client to retrieve more data from the server without reloading the whole page
  • 6. Fundamental • Ajax comprises of three key components } The DOM •CSS •(X)HTML •JavaScript Document Object Model Image from: http://tinyurl.com/domTree
  • 7. How to? • Initialize the request • Configure the connection • Tell it, what to do when? (on state changes) • Send the request
  • 8. How to: Initializing the request • ourAjaxObject =  new XMLHttpRequest(); • XMLHttpRequest: DOM API that can be used by web browser scripting languages to transfer XML & other text data between a web server & a browser. - wikipedia function getAjaxObject() { try {return new XMLHttpRequest(); } catch (err) { try {return new ActiveXObject(quot;Msxml2.XMLHTTPquot;); } catch (err) { try{ return new ActiveXObject(quot;Microsoft.XMLHTTPquot;); } catch (err) {return false;} } } } • ourAjaxObject = getAjaxObject()
  • 9. How to: Configure the connection •The Ajax Workflow •What request method to use GET/POST •Where to go •Whether or not to go there asynchronously •ajaxObject = getAjaxObject() •ourAjaxObject.open(method, url, true); •ourAjaxObject.open(method, url, false); •URL: •url = ‘./getData.php’ •parameters = ‘name=aman&place=pune&contact=mail@amanjain.com’ •If(method=‘GET’){url = url+”?”+parameters }
  • 10. How to: Overview • function getAjaxObject() { try {return new XMLHttpRequest(); } catch (err) { try {return new ActiveXObject(quot;Msxml2.XMLHTTPquot;); } catch (err) { try{ return new ActiveXObject(quot;Microsoft.XMLHTTPquot;); } catch (err) {return false;} } } } • ourAjaxObject = getAjaxObject() •If(ourAjaxObject != false){ method = “GET”; url = “./getData.php”; parameters = ‘name=aman&place=pune&contact=mail@amanjain.com’; If(method==“GET”){url = url+”?”+parameters; parameters=null; } ourAjaxObject.open(method, url, true); }
  • 11. How to: Tell it, what to do when? -part I •onreadystatechange is a event handler for an event that fires at every state change •Possible readyState values are: •0 = uninitialized (unsent) •1 = opened •2 = headers received •3 = loading •4 = complete •ourAjaxObject.onreadystatechange = callMe ; •ourAjaxObject.send(parameters); i.e. parameters will be null if method is GET
  • 12. Backend: Replying with plain text <?php $name = $_GET[‘name’]; $place = $_GET[‘place’]; $contact = $_GET[‘contact’]; echo “hi! $name. Nice to meet you at $place will mail you the further details at $contact.”; ?>  
  • 13. Backend: Replying XML <?php $name = $_GET[‘name’]; $place = $_GET[‘place’]; $contact = $_GET[‘contact’]; header('Content-Type: text/xml'); //setting the header echo ‘<?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>’; echo quot;n<root>”; echo quot;nt<name>$name</name>”; echo quot;nt<place>$place</place>”; echo quot;nt<contact>$contact</contact>”; echo quot;n</root>”; ?>
  • 14. How to: Tell it, what to do when? -part II •function callMe() { if(ourAjaxObject.readyState == 4 ) { alert(“we are receiving the data”); dataReceived = ourAjaxObject.responseText //for plain text, JSON // OR dataReceived = ourAjaxObject.responseXML, for XML } }
  • 15. Properties & Description of XMLHttpRequest
  • 16. Methods & Description of XMLHttpRequest METHOD DESCRIPTION abort()                                    Stops the current request getAllResponseHeaders()   Returns all headers (name and value) as a string getResponseHeader(quot;<name>quot;)    Returns the value of the specified header Open(method,url,true/false)      Opens a connection and retrieves response from the specified URL. send(content)                            Transmits request setRequestHeader(quot;<name>quot;, quot;<value>quot;) Assigns values to the specified header  
  • 17. J avascript Libraries (e.g. jQuery) jQuery is a lightweight JavaScript library that emphasizes interaction between JavaScript and HTML. –wikipedia Method: <script type=quot;text/javascriptquot; src=quot;/path/to/jQuery.jsquot;></script> dataReceived = $.ajax({ type:quot;POSTquot; url:quot;./getData.phpquot;, data:quot;name=aman&place=pune&contact=mail@amanjain.comquot;, async: false }).responseText; // OR responseXML
  • 19. Wanna ping me ? My blog: http://blog.amanjain.com My email: mail@amanjain.com My Twitter handle :@amanjain (http://twitter.com/amanjain) Download this doc: http://amanjain.com/docs/ajax.pdf Most Important Learn something new everyday at: http://PHPCamp.net