Google


ADBRITE ads links
You are here: CodeIdol.com > Ajax > Head Rush Ajax > Making Ajax Requests Speaking The Language > Send The Request To The Server

SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

2.26. Send the request to the server

All that's left to complete this step is to actually send the request. This is a piece of cake, as you saw in Chapter 1. Let's look at the last line of getCustomerInfo() now:

    function getCustomerInfo() {
      var phone = document.getElementById("phone").value;
      var url = "lookupCustomer.php?phone=" + escape(phone);
      request.open("GET", url, true);
      request.onreadystatechange = updatePage;Make sure you set up the function for
the browser to run when the ready state changes before you call send().
      request.sendWe sent the
customer's phone number as part of the request
URL, so we don't need to send any other data to the server.(null);This sends
the request to the Break Neck web server.
    }

So I'm still waiting to find out more about when that ready state changes.

Just Do It

Make sure you're keeping your version of pizza.html up to date. Open up pizza.html, and add the getCustomerInfo() function if you haven't already. You should also have lookupCustomer.php in the same directory as your pizza.html and breakneck.css files.



SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

You are here: CodeIdol.com > Ajax > Head Rush Ajax > Making Ajax Requests Speaking The Language > Send The Request To The Server
   
Related tags







Popular Categories
Unix books and guides
AJAX popular information
C# language guides
Windows books and cookbooks
.......






© CodeIdol Labs, 2007