Php $\u在IE 7中使用Ajax获取[]
我有一些使用标准ajax的代码:Php $\u在IE 7中使用Ajax获取[],php,ajax,internet-explorer,get,Php,Ajax,Internet Explorer,Get,我有一些使用标准ajax的代码: function getLiveGame() { var gameid = "<?php echo $gameid ?>"; var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } els
function getLiveGame()
{
var gameid = "<?php echo $gameid ?>";
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("livegame1").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","livegame2.php?&refresh="+Math.random()+"&gameid="+gameid,true);
xmlhttp.send();
}
现在在运行此ajax的页面上
firefox上显示:15(正确传递的gameid)
在IE上它说:未定义(这是不正确的)
我怎样才能让它为IE工作/有什么问题
非常感谢,我很想说问题出在IE上:>我很确定在IE中做ajax是可能的。OIs代码是在js文件还是php文件中?它在php文件中*编辑:但它确实有一个环绕它的注释:让它在IE中工作虽然很奇怪,但不知道真正的原因我只是把脚本放在上面(^ javascript代码)我的php页面的底部,它在IE中工作。。。威德。。。
$gameid = $_GET['gameid'];
echo $gameid;