function chrpajaxscri( formmeth, phpurl ) {
var x = new XMLHttpRequest();
x.open( formmeth, phpurl, true );
x.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
return x;
}
function ajaxReturn(x){
if(x.readyState == 4 && x.status == 200){
return true;
}
}
function chrpsendemail(x,p,e,id,upd,to){
var name = document.getElementById(id).value;
var email = document.getElementById(e).value;
if (name != ""){
document.getElementById(upd).innerHTML = "Please wait sending ...";
var ajax = chrpajaxscri("POST", x);
ajax.onreadystatechange = function (){
if(ajaxReturn(ajax) == true) {
document.getElementById(upd).innerHTML = ajax.responseText;
}
}
ajax.send("product="+p+"&email="+email+"&name="+name+"&to="+to);
}
}
上面是我用来向另一个文件发送请求的代码,但这适用于除谷歌浏览器以外的所有浏览器。从我可以告诉它的铬的错误,但我仍然需要一个修复可以任何人帮助请