Search Amazon:

Page 2 of 6               << Previous  1  2  3  4  5  6  Next >>

 

AJAX (Asynchronous JavaScript And XML) Tutorial

The XMLHttpRequest Object

You need to know some background on the XMLHttpRequest object before you can use it. The XMLHttpRequest object has the following important properties and methods:

readyState Property
The readyState property contains the status of the server's response as shown in the following table.

State

Meaning

0

The request was initialized

1

The request was set up

2

The request was sent

3

The request is in process

4

The request is complete

status Property
The Status property holds the HTTP status code returned from the server. A valid code of 200 is desired. Invalid codes may include 404 - Page Not Found, 500 - Server Error, etc.

responseText Property
The responseText property contains the data sent back from the server as a text string.

responseXML Property
The responseXML property contains the data sent back from the server as an XML document.

onreadystatechange Property
The onreadystatechange property stores the function that will process the response from a server.

open Method
The open method is used to open a HTTP request and takes three arguments. The first argument denotes which method, GET or POST, to use when sending the request. The second argument indicates the URL of the server-side script. The last argument dictates whether the request should be run asynchronously.

send Method
As its name implies, the send method sends the request to the server.


Page 2 of 6               << Previous  1  2  3  4  5  6  Next >>

Sign In
  User Id 
  Password 


Submit Your Own Code and Articles




About TheScarms
About TheScarms

Ask me your programming questions

I read every email and answer all I can.

User Feedback: Be the first to add a comment! Items to Show:     

     
You must log in to post feedback.
Comment:    
 

If you use this code, please mention "www.TheScarms.com"

Email this page


TheScarms AppSentinel lets you securely copy protect and create evaluation versions of your software

TheScarms(tm) AppSentinel lets you quickly and easily create evaluation versions of your software and stop unauthorized copying and unregistered use of your programs!

Get your free
trial copy today!


      The World's Number 1 Web Host

© Copyright 2008 TheScarms