AJAX刷新多个DIV中的内容问题????
<script type="text/javascript">
<!--
//建立XMLHttpRequest对象
var xmlhttp;
try{
xmlhttp= new ActiveXObject('Msxml2.XMLHTTP');
}catch(e){
try{
xmlhttp= new ActiveXObject('Microsoft.XMLHTTP');
}catch(e){
try{
xmlhttp= new XMLHttpRequest();
}catch(e){}
}
}
function getNews(url){
xmlhttp.open("get",url,true);
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState == 4)
{
if(xmlhttp.status == 200)
{
if(xmlhttp.responseText!=""){
document.getElementById("newsdiv").innerHTML = unescape(xmlhttp.responseText);
}
}
else{
document.getElementById("newsdiv").innerHTML = "数据载入出错";
}
}
}
xmlhttp.setRequestHeader("If-Modified-Since","0");
xmlhttp.send(null);
}
//-->
</script>
这段代码只能一个DIV更新。。。。。。。。如果有多个DIV要同时更新该怎么做?