0
Good morning, I’m created a code Java to send data using AJAX to a PHP page,my problem is that the POST is going empty to page I’m calling. This only happens when I call the Javascript (AJAX) function that makes the request, when I call the PHP page straight through 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);
}
Puts the
headers
and theurl
. And what would be archive ?– Edilson
the filing cabinet would be mine url, I did so because I intend to use this same function for more cases. I tried to use the header, but it hadn’t worked so I removed.
– Rayan Pereira de Lima