我正在开发基于 Web 的应用程序,我正在使用 JSP 创建一个应用程序,使用 ajax 从 Mysql 数据库获取数据。该代码在其他浏览器上运行良好,但在 Internet Explorer-9 上运行不正常。
我如何在 Internet Explorer 上顺利运行它。请在这方面帮助我。代码如下:
function getwords2(val)
  {document.getElementById("getcharter1").style.display ='block';
   if (val=="")
  {document.getElementById("getcharter1").innerHTML="";
  return;
}if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }xmlhttp.onreadystatechange=function()
  {  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {       document.getElementById("getcharter1").innerHTML=xmlhttp.responseText;
  }  }xmlhttp.open("GET","getvalue.jsp?ch="+document.FM.val.value+"&w1=2",true);
xmlhttp.send();}