11.07.2015 Views

AJAX and PHP

AJAX and PHP

AJAX and PHP

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Client-Side Techniques with Smarter JavaScript// h<strong>and</strong>les the response received from the serverfunction h<strong>and</strong>leServerResponse(){// read the message from the servervar xmlResponse = xmlHttp.responseXML;// obtain the XML's document elementxmlRoot = xmlResponse.documentElement;// obtain arrays with book titles <strong>and</strong> ISBNstitleArray = xmlRoot.getElementsByTagName("title");isbnArray = xmlRoot.getElementsByTagName("isbn");// generate HTML outputvar html = "";// iterate through the arrays <strong>and</strong> create an HTML structurefor (var i=0; i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!