下面的代码演示了如何执行此操作。
var http = new XMLHttpRequest();var url = 'get_data.php';var params = 'orem=ipsum&name=binny';http.open('POST', url, true);//Send the proper header information along with the requesthttp.setRequestHeader('Content-type', 'application/x-www-form-urlenpred');http.onreadystatechange = function() {//Call a function when the state changes. if(http.readyState == 4 && http.status == 200) { alert(http.responseText); }}http.send(params);


