Ajax POST Request

/ Published in: JavaScript
Save to your folder(s)

Copy this code and paste it in your HTML
  1. var xmlhttp = new XMLHttpRequest();
  2. xmlhttp.open('POST', 'http://whatever.com/myscript.php', true);
  3. xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
  4. xmlhttp.onreadystatechange = function() {
  5. };
  6. xmlhttp.send('param=5');

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.