|
|
|
| HOME | J2ME | Struts | AJAX | SOAP | SOA | MEDIA STREAMING | AXIS | | |
|
|
AJAX: Functions of XMLHttpRequestBack | Tutorial Home | Next There are various functions associated with XMLHttpRequest which need
to be used to complete AJAX life cycle. Following are the various functions
of XMLHttpRequest object
Aborts the current executing request. getAllResponseHeaders() Use this method to get response headers as a key-value pairs separated by a colon getResponseHeader(header) Returns the value of the specified header. open() This method is used to populate the XmlHttpRequest object before firing a HTTP request to the server. Simplest form of this method takes two values as parameters Method: Can be GET, POST and PUT var url="/inc/word.php";
send() This method finally sends the request to the server. This method has following method signature send(String requestParameters) requestParameters is null for GET method and a string similar to Query string in case of POST method. Lets see how we can do a login request using send() method Send using GET
var url="login.php?id=tom&pass=salsa123; Send using POST var url="login.php; setRequestHeader() foo.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); Back | Tutorial Home | Next site comments powered by Disqus |
|
| toolbar powered by Conduit |
|
| Copyright © 2009. All rights reserved | Terms and Conditions | About | Contact | Feed Back | |