We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

1man on 03/12/07


Tagged

ajax post request book


Versions (?)


Who likes this?

2 people have marked this snippet as a favorite

vali29
korzhik


Ajax Post Request


Published in: JavaScript 


Simple Ajax POST request using the getHTTPObject function.

  1. var request = getHTTPObject();
  2. if(request){
  3. request.onreadystatechange = doSomething;
  4. request.open("POST", "file.ext", true);
  5. request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  6. request.send("name=whatever+goes+here&message=hello+world");
  7. }

Report this snippet 

You need to login to post a comment.