0

我已经做了任何可能的搜索,但仍然感到困惑。我试图将两个变量发送到某个 php 页面,但我的脚本仅适用于 IE;其他浏览器不想发送请求。怎么了?谢谢!

<script language="JavaScript" type="text/javascript">
function sendwnls(){

var hr = new XMLHttpRequest();

var url = "php_inc/rati.php";
var wn = "<?php echo $ln1 ?>";
var lns = "<?php echo $ln2 ?>";
var vars = "wn="+wn+"&ls="+ls;

hr.open("POST", url, true);

hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

 hr.onreadystatechange = function() {
 if(hr.readyState == 4 && hr.status == 200) {
  var return_data = hr.responseText;
  document.getElementById("status").innerHTML = return_data;
  }
  }

  hr.send(vars); // Actually execute the request
document.getElementById("status").innerHTML = "processing...";
}
4

0 回答 0