日期:2014-05-16  浏览次数:20466 次

JQ输出HTML内容,有时可以有时不行,特别是IE,firefox正确显示
JS代码
$.post("/res/ashx/onlineTest.ashx?a=getUserInfo", function (d) {
  if ($.trim(d) == "noInfo") {
  top.location = "/default.html";
  }
  else {
  $("#userInfo").html("姓名:" + $.trim(d).substring($.trim(d).indexOf("|", 0) + 1, $.trim(d).length) + " 身份证号:" + $.trim(d).substring(0, $.trim(d).indexOf("|", 0)));
  getLeftTime();
  }
});

功能是去到服务器获取信息,但在IE中不能直接显示,F5刷新后也不显示,要在地址栏按一下回车,才能显示userInfo内容,但是FIREFOX能正常显示出来,这是为什么呀,谢谢

------解决方案--------------------
有缓存?
试试: "/res/ashx/onlineTest.ashx?a=getUserInfo"+"&nocache="+new Date()
------解决方案--------------------
探讨

$.post("/res/ashx/onlineTest.ashx?a=getUserInfo" + "&nocache=" + new Date(), function (d) {
if ($.trim(d) == "noInfo") {
top.location = "/default.html";
}
else {
……