var row;
var cell;
var img;
var tbody = filelist.childNodes[0];
var lengths,x,i=1;
var filename,fileid;
lengths=msg.length;
x=msg.substr(msg.lastIndexOf("|")+1,lengths-msg.lastIndexOf("|"))
//alert(x);
msg=msg.substr(0,msg.lastIndexOf("|")+1)
//alert(msg);
var child=filelist.childNodes[0];
//alert(tbody.childNodes.length);
for(i=1;tbody.childNodes.length!=1;i++)
{
tbody.removeChild(tbody.childNodes[1]);//清除原有的结点
}
// alert(tbody.childNodes.length+"***");
for (var i=0; i<=x; i++)//10行
{
filename=msg.substr(0,msg.indexOf("|",0))
msg=msg.substr(msg.indexOf("|",0)+1,lengths-msg.indexOf("|",0)-1)
fileid=msg.substr(0,msg.indexOf("|",0))
msg=msg.substr(msg.indexOf("|",0)+1,lengths-msg.indexOf("|",0)-1)
//alert(filename)
//alert(fileid)
//alert(msg)
if(filename!=""&&fileid!="")
{
row = document.createElement( "<tr bgcolor=/"#FFFFFF/"></tr>" );
tbody.appendChild( row );
for (var j=0; j<2; j++)//2列
{
cell = document.createElement( "TD" );
row.appendChild( cell );
if(j==0)
{
cell.innerText =filename;
}
else
{
document.all.file.value="";
cell.innerText=" ";
img=document.createElement("img");
img.src="images/delete.gif";
cell.appendChild(img);
img.attachEvent("onclick",function(){alert(fileid);});//绑定一个事件
}
}
}
}
var cell;
var img;
var tbody = filelist.childNodes[0];
var lengths,x,i=1;
var filename,fileid;
lengths=msg.length;
x=msg.substr(msg.lastIndexOf("|")+1,lengths-msg.lastIndexOf("|"))
//alert(x);
msg=msg.substr(0,msg.lastIndexOf("|")+1)
//alert(msg);
var child=filelist.childNodes[0];
//alert(tbody.childNodes.length);
for(i=1;tbody.childNodes.length!=1;i++)
{
tbody.removeChild(tbody.childNodes[1]);//清除原有的结点
}
// alert(tbody.childNodes.length+"***");
for (var i=0; i<=x; i++)//10行
{
filename=msg.substr(0,msg.indexOf("|",0))
msg=msg.substr(msg.indexOf("|",0)+1,lengths-msg.indexOf("|",0)-1)
fileid=msg.substr(0,msg.indexOf("|",0))
msg=msg.substr(msg.indexOf("|",0)+1,lengths-msg.indexOf("|",0)-1)
//alert(filename)
//alert(fileid)
//alert(msg)
if(filename!=""&&fileid!="")
{
row = document.createElement( "<tr bgcolor=/"#FFFFFF/"></tr>" );
tbody.appendChild( row );
for (var j=0; j<2; j++)//2列
{
cell = document.createElement( "TD" );
row.appendChild( cell );
if(j==0)
{
cell.innerText =filename;
}
else
{
document.all.file.value="";
cell.innerText=" ";
img=document.createElement("img");
img.src="images/delete.gif";
cell.appendChild(img);
img.attachEvent("onclick",function(){alert(fileid);});//绑定一个事件
}
}
}
}