Section 2.20. Back to getCustomerInfo()


2.20. Back to getCustomerInfo()

With the request object taken care of, let's get back to coding getCustomerInfo(). Remember where we left this function?

     function getCustomerInfo() {       var phone = document.getElementById("phone").value;This is the code you wrote back in Step 1.       createRequest();Get rid of this line... now our request object is created in static JavaScript.       var url = "lookupCustomer.php?phone=" +                 escape(phone);Next up is getting the PHP   script working on the Break Neck server.       request.open("GET", url, true);       request.onreadystatechange = updatePage;       request.send(null);     } 




Head Rush Ajax
Head Rush Ajax (Head First)
ISBN: 0596102259
EAN: 2147483647
Year: 2004
Pages: 241

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net