Google


ADBRITE ads links
You are here: CodeIdol.com > Ajax > Head Rush Ajax > Making Ajax Requests Speaking The Language > Finishing Off The Callback Function

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

2.35. Finishing off the callback function

With the address from the server, all that's left is to update the web form. Since the address is stored in a form field, you can use the DOM again, similar to how you got the value of the phone number field in getCustomerInfo() way back on page 82.

function updatePage() 
 {
  if (request.readyState == 4) {
    /* Get the response from the server */
    var customerAddress = request.responseText;
    /* Update the HTML web form */
Here's where those id attributes come in handy again.
    document.getElementById("address").value =
Since address is a form field, you can
access the text in it using the "value" property.
      customerAddress;You're using the DOM again... this time to set a value
in the web form.Just set the field's value to the customer's address.
  }
}


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 > Finishing Off The Callback Function
   
Related tags







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






© CodeIdol Labs, 2007