dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: JavaScript
Expertise: Intermediate
Oct 3, 2003

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Use the XMLHttpRequest Object to Post Data

When using XMLHttpRequest object, there is a way to post data in the same way that an HTML Form is posted.

All you need to do is add an HTTP header, and send the data the same way you'd send it on the QueryString.

Here's a JScript example for the client side, that submits form data to another page:


  var objHTTP, strResult;
  objHTTP = new ActiveXObject('Microsoft.XMLHTTP');
  objHTTP.open('POST',"OtherPage.asp",false);
  objHTTP.setRequestHeader('Content-Type',
'application/x-www-form-urlencoded');

  objHTTP.send("id=1&user="+txtUser.value+"&password="+txtPassword.value);

  strResult=objHTTP.responseText;
Aviv Raff
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date