ajax函数在ie10上不起作用

ajax函数在ie10上不起作用,ajax,Ajax,我使用此代码获取每个教师的课程列表此代码在所有浏览器中都可以正常工作,但在ie10中无法获取课程列表并返回空白选择列表 function get_lesson(lesson) { var getid=lesson; document.getElementById("ajax_msg").innerHTML='<span style="color:red">Update</span>'; var xmlhttp; if (windo

我使用此代码获取每个教师的课程列表此代码在所有浏览器中都可以正常工作,但在ie10中无法获取课程列表并返回空白选择列表

 function get_lesson(lesson)
    {
    var getid=lesson;
    document.getElementById("ajax_msg").innerHTML='<span style="color:red">Update</span>';
    var xmlhttp;
    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("ajax").innerHTML=xmlhttp.responseText;
        document.getElementById("ajax_msg").innerHTML='Now Select';

        }
      }
      xmlhttp.open("GET","subpage/ajax_lesson.php?id=" + getid + "&tnow="+ (new Date()).getTime(),true);
    xmlhttp.send();

    }
函数获取课程(课程)
{
var getid=lesson;
document.getElementById(“ajax_msg”).innerHTML='Update';
var-xmlhttp;
if(window.XMLHttpRequest)
{//IE7+、Firefox、Chrome、Opera、Safari的代码
xmlhttp=新的XMLHttpRequest();
}
其他的
{//IE6、IE5的代码
xmlhttp=新的ActiveXObject(“Microsoft.xmlhttp”);
}
xmlhttp.onreadystatechange=函数()
{
if(xmlhttp.readyState==4&&xmlhttp.status==200)
{
document.getElementById(“ajax”).innerHTML=xmlhttp.responseText;
document.getElementById(“ajax_msg”).innerHTML='Now Select';
}
}
xmlhttp.open(“GET”,“subpage/ajax_lesson.php?id=“+getid+”&tnow=“+(new Date()).getTime(),true);
xmlhttp.send();
}

IE 10似乎对ajax有问题。 请参阅:

HTH,

用户jquery ajax函数