用XML+FSO+JS实现服务器端文件的(3)


len=oRoot.children.length;
if (len==1)
{oItem = oRoot.children.item(0);
if(oItem.children.item(0).text=="empty")
strshow="没有文件和文件夹了";
else
{
if(oItem.children.item(0).text=="folder")
{
strshow+="<tr><td><A href=\"javascript:parent.userlist('"+folders+oItem.children.item(1).text+"/"+"',1)\"><img src=\"images/mediafolder.gif\" border=0 >"+oItem.children.item(1).text+"</A></td></tr>";
}
else
{
strshow+="<tr><td><a href=\"javascript:parent.addfile('"+oItem.children.item(1).text+"')\" ><img src=\"images/mediafile.gif\" border=0>"+oItem.children.item(1).text+"</A></td></tr>";

}
}
strshow+="</table>"
}
else{
//数据入栈
for(i=0;i<len;i++)
{ oItem = oRoot.children.item(i);
if(oItem.children.item(0).text=="folder")
{
arrff[i]="<A href=\"javascript:parent.userlist('"+folders+oItem.children.item(1).text+"/"+"',1)\"><img src=\"images/mediafolder.gif\" border=0>"+oItem.children.item(1).text+"</A>";
}
else
{
arrff[i]="<A href=\"javascript:parent.addfile('"+oItem.children.item(1).text+"')\"><img src=\"images/mediafile.gif\" border=0 height=12>"+oItem.children.item(1).text+"</A>";

}
}
//取得要输出的列数
if (len<=6)
{x=1;
y=6;}
else
{x=len/6;
y=6;}
for(var i=0;i<y;i++)
{strshow+="<tr>"
for(var j=0;j<x;j++)
{ponits=j*y+i;
if (ponits>=len)
{
strshow+="<td> </td>";
}
else
{
strshow+="<td>"+arrff[ponits]+"</td>";
}
}
strshow+="</tr>"
}

strshow+="</table>"
}
filebox.document.body.innerHTML=strshow;
}
//-->
</SCRIPT>
<script LANGUAGE="vbscript">
function checkfolder(folderstr)
if (folderstr="" or instr(folderstr,"/")=instrrev(folderstr,"/")) then
checkfolder=""
else
nfolder=left(folderstr,len(folderstr)-1)
checkfolder=left(nfolder,instrrev(nfolder,"/"))
end if
end function
</script>
</HEAD>

<BODY style="margin:0" bgColor=menu onload="javascript:userlist('',0)">
<table width="443" border="0" cellspacing="0">
<tr>
<td height="36"><table width="409" border="0">
<tr>
<td width="73" align="right">查找范围(<u>I</u>):</td>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3703.html