Hello, I have a javaScript code to send data using AJAX to a PHP page, my problem is that the POST is going empty for the page I am calling. This only happens when I call the JavaScript (AJAX) function that does the request, when I call the PHP page direct by the action POST works normally. What can it be?
function AjaxExecute(arquivo){
var ajax;
if(window.XMLHttpRequest){
ajax = new XMLHttpRequest();
} else {
try{
ajax = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
ajax = new ActiveXObject("Microsoft.XMLHTTP");
}
}
ajax.onreadystatechange = function(){
if(ajax.readyState == 4 && ajax.status == 200){
return this.responseText;
}
}
ajax.open("post",arquivo);
ajax.send(null);
}