急急急 !!!!AJAX 在Chrome浏览器中没反应怎么办 ???
不要复制百度的 都说在服务端调用 关键是在服务端怎么调用
我页面的代码:
<script type="text/javascript">
function huoqu(){
var obj=Test.sayHello('World!')
var s = document.getElementById("guojia");
var gid = s[s.selectedIndex].value;
var activeX = new ActiveXObject("Microsoft.XMLHTTP");
activeX.open("get","change.action?gid="+gid,true);
activeX.onreadystatechange=function (){
if (activeX.readyState == 4){
document.getElementById("chengshi").innerHTML=activeX.responseText;
}
}
activeX.send();
}
</script>
在IE上面都是好使的 在Chrome中怎么办
在我代码基础上怎么改
各位大侠请指教 最好能用代码说明下
------解决方案--------------------
HTML code
<script type="text/javascript">
function huoqu(){
var obj=Test.sayHello('World!')
var s = document.getElementById("guojia");
var gid = s[s.selectedIndex].value;
if(window.XMLHttpRequest){
var activeX = new XMLHttpRequest();
}else if(window.ActiveXObject){
var activeX = new ActiveXObject("Microsoft.XMLHTTP");
}
activeX.open("get","change.action?gid="+gid,true);
activeX.onreadystatechange=function (){
if (activeX.readyState == 4){
document.getElementById("chengshi").innerHTML=activeX.responseText;
}
}
activeX.send();
}
</script>