java读取XML然后填充HTML出问题了,请高手们帮小弟看一下
填充代码如下:
<script type= "text/javascript ">
var xmlHttp = false;
function createXmlHttp(){
try {
xmlHttp=new ActiveXObject( "Msxml2.XMLHTTP ");
} catch (e) {
try {
xmlHttp=new ActiveXObject( "Microsoft.XMLHTTP ");
} catch (E) {
xmlHttp = false;
}
}
if(!xmlHttp && XMLHttpRequest != "undefined "){
xmlHttp = new XMLHttpRequest();
}
}
function show(){
createXmlHttp();
xmlHttp.onreadystatechange = showall;
xmlHttp.open( "post ", "allMsg.do ",true);
xmlHttp.send(null);
}
function showall(){
if(4==xmlHttp.readyState){
if(200==xmlHttp.status){
var list = document.getElementById( "oldmsg ");
var xml = xmlHttp.responseXML;
var msgs = xml.getElementsByTagName( "msg ");
alert(msgs.length):
for(var i=0;i <msgs.length;i++){
var dl = document.createElement( "dl ");
var dt = document.createElement( "dt ");