+ -
当前位置:首页 → 问答吧 → js get 方法拒绝访问

js get 方法拒绝访问

时间:2011-12-07

来源:互联网

我有这样一段JS代码,在火狐下面运行正常没事,但是在IE下就报JS错误,说拒绝访问,也就是$get()方法过不去,请问这是什么原因,该如何解决?

  if (rlt == '1') {
  var userName = document.getElementById("TB_Account").value;
   
  if (userName == "" || userName == null) {
  return;
  } else {
  $.get("http://192.168.0.188:120/shortcut/reg.aspx?par=" + userName + "&ab=" + Math.random(), function (result) {
  alert("返回值:" + result);
  //如果已注册
  if (result == 1) {
  notice.className = "log_fx";
  // aWritenResult = "0";
  return false;
  }
  //如果未注册
  else if (result == 0) {
  notice.className = "log_fh";
  // aWritenResult = "1";
  return true;
  }
  else {

  notice.className = "log_fx";
  // aWritenResult = "0";
  return false;
  }
  });
  }
  }

作者: benben_tong   发布时间: 2011-12-07

是不是浏览器兼容问题啊 你可以判断一下浏览器

作者: hefeng_aspnet   发布时间: 2011-12-08

跨域了把

作者: Sandy945   发布时间: 2011-12-09

相关阅读 更多