How do you make a simple POST request in Javascript without using a forms and without posting back?
See Question&Answers more detail:osHow do you make a simple POST request in Javascript without using a forms and without posting back?
See Question&Answers more detail:osThough I am taking the code sample from @sundeep answer, but posting the code here for completeness
var url = "sample-url.php";
var params = "lorem=ipsum&name=alpha";
var xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
//Send the proper header information along with the request
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.send(params);