Ajax html中的table显示问题(IE不显示,firefox正常)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script language="javascript">
function a()
{
}
function b()
{
}
function c()
{
}
Function.prototype.bind=function()
{
var self=this;
var arg=arguments;
return function ()
{
self.apply(null,arg);
}
}
</script>
<script type="text/javascript">
var xmlHttp;
var c="";
function createXMLHttpResponse()
{
if(window.ActiveXObject)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlHttp=new XMLHttpRequest();
}
}
function formsubmit()
{
createXMLHttpResponse();
var url="AvatarList.aspx?UserID=52";
xmlHttp.onreadystatechange=handleStateChange;
xmlHttp.open('get',url,true);
//xmlHttp.setRequestHeader("If-Modified-Since","0");
xmlHttp.send(null);
}
function handleStateChange()
{
if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
var xmlobj=xmlHttp.responseXML;
var elemDoc=xmlobj.getElementsByTagName("Avatar_table");
if(document.body.firstChild!=null)
{
document.body.removeChild(document.body.firstChild);
}
var table=document.createElement("table");
var div=document.getElementById("div1");
div.appendChild(table);
table.setAttribute("border","1");
table.setAttribute("width","50%");
table.setAttribute("cellspacing",0);
table.setAttribute("cellpadding",0);
var head=table.createTHead();
var headrow=head.insertRow(0);
headrow.insertCell(0).appendChild(document.createTextNode("ID"));
headrow.insertCell(1).appendChild(document.createTextNode("图片名"));
headrow.insertCell(2).appendChild(document.createTextNode("文件名"));
for(var i=0;i<elemDoc.length;i++) { // 循环读取
var singleCur = elemDoc[i];
row=table.insertRow(i+1);
var input=document.createElement('input');
input.type='checkbox';
var f=function(i)
{
var obj=document.getElementById("checkbox"+i);
if(obj.checked==true)
{
c=c+obj.value+",";
}
else
{
}
}
input.id="checkbox"+i;
input.value=singleCur.childNodes[0].text;
// input.value=singleCur.getElementsByTagName("AlBUM_ID")[0].firstChild.data;
input.onclick=f.bind(i);
row.insertCell(0).appendChild(input);
// row.insertCell(0).appendChild(document.createTextNode(
// singleCur.getElementsByTagName("ALBUM_ID")[0].firstChild.data));
row.insertCell(1).appendChild(document.createTextNode(
singleCur.getElementsByTagName("AVATAR_URL")[0].firstChild.data));
row.insertCell(2).appendChild(document.createTextNode(
singleCur.getElementsByTagName("AVATAR_NAME")[0].firstChild.data));
}
var Del_button=document.createElement("input");
Del_button.type="Button";
Del_button.value='删除所选个人形象';
Del_button.onclick=a;
div.appendChild(Del_button);
var Chuan_button=document.createElement("input");
Chuan_button.type="Button";
Chuan_button.value="穿所选个人形象";
Chuan_button.onclick=b;
div.appendChild(Chuan_button);
var Tuo_button=document.createElement('input');
Tuo_button.type="Button";
Tuo_button.value="脱所选个人形象";
Tuo_button.onclick=c;
document.body.appendChild(Tuo_button);
div.appendChild(Tuo_button);
}
}
}
</script>
</head>
<body onload="formsubmit()">
//这个table显示不出来
<table border="1" style="z-index: 101; left: 13px; width: 895px; position: absolute;top: 3px; display: block; height: 90px;">
<tr>
<td style="height: 84px; width: 690px;">
<label>1688Star.com</label> <a href="" ></a>
<a href="" style="z-index: 103; left: 173px; width: 35px; position: absolute;top: 10px; height: 18px">聊天</a>
<a href="" style="z-index: 104; left: 218px; position: absolute;top: 10px">好友</a>
<a href="" style="z-index: 105; left: 262px; position: absolute;top: 10px">纸条</a>
<a href="" style="z-index: 106; left: 308px; position: absolute;top: 11px">网上商城</a>
<a href="" style="z-index: 107; left: 381px; position: absolute;top: 12px">顾客中心</a>
<a href="" style="z-index: 108; left: 463px; position: absolute;top: 12px">帮助</a>
<a href="UpdatePersonal.htm" style="z-index: 109; left: 146px; position: absolute;top: 57px">个人信息修改</a>
<a href="" style="z-index: 102; left: 129px; position: absolute;top: 9px">home</a>
<a href="" style="z-index: 110; left: 255px; position: absolute;top: 57px">个人相册</a>
<a href="PersonalPicture.htm" style="z-index: 111; left: 332px; position: absolute;top: 56px"> 愿望箱</a>
<a href="" style="z-index: 112; left: 403px; position: absolute;top: 57px">账本</a>
<a href="yigui.htm" style="z-index: 113; left: 460px; position: absolute;top: 56px">衣柜</a>
</td>
</tr>
</table>
//table结束
<a href="" style="z-index: 103; left: 13px; position: absolute;top: 107px">个人信息修改</a>
<a href="" style="z-index: 104; left: 185px; position: absolute;top: 109px">个人相册</a>
<a href="" style="z-index: 105; left: 310px; position: absolute;top: 110px">愿望箱</a>
<a href="" style="z-index: 106; left: 422px; position: absolute;top: 111px">我的账本</a>
<a href="" style="z-index: 107; left: 538px; position: absolute;top: 112px">礼物信息</a>
<label style="z-index: 108; left: 11px; position: absolute;top: 143px">衣柜</label>
<label style="z-index: 109; left: 14px; position: absolute;top: 170px">亲爱的XXX,您所拥有的个人形象</label>
<div id="div1" style="z-index: 102; left: 14px; width: 607px; position: absolute; top: 206px;height: 345px"></div>
</body >
</html>