大家可以试试,在左边的单行文本框内固无法输入,在右边大方框里的单行文本框也无法输入了,连select都无法选择了。
解决方案 »
- 这句代码有什么作用
- win7 32bit 和 win7 64bit的区别?
- javascript如何获取flash的加载进度
- 《Javascript DOM高级程序设计》这本书咋样?
- ext怎么把一个json字符串变成可以用的json对象
- 页面关闭提示
- 急求JS加载控制顺序 方案(有难度)
- 一个for循环问题 ,求大侠指教
- 应朋友要求,现将 WebHtmlEditor 1.5 and 1.6 中用到的 js 混淆器提供给大家使用
- 请教高手!!(急急)通过javascript能够得到html中的页面的链接地址吗?在线苦等
- 急,在线等待!自动跳转问题 url=./default.asp
- 判断多个radio
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head><body>
<script language="JavaScript" type="text/JavaScript">
var fso
var filepaths="C:";
var fsoflag=0;
var showfolder=0;
var folderblur=0;
</script>
<a href="javascript:" onClick="if(!fsoflag){fso = new ActiveXObject('Scripting.FileSystemObject');fsoflag=1;}showfolder=1;document.all.dofiles.style.visibility='visible';showdriveexit('C:','.rjs');document.all.dofiles.focus();"><font style="color:black;font-size:14px">文件浏览</font></a>
<div id="dofiles" style="position:absolute; left:63px; top:46px; width:469px; height:373px; z-index:2; visibility: hidden;" onFocus="folderblur=1" onBlur="folderblur=0">
<script language="JavaScript" type="text/JavaScript">
function runfolder(){
if(showfolder){
if(!folderblur){document.all.dofiles.focus();}
}
}
setInterval('runfolder()',200)
</script>
<form name="openwritefiles" method="post" action="">
<table width="100%" height="100%" border="1">
<tr>
<td width="50%" height="20" valign="top"><input name="filename" type="text" size="25" onFocus="folderblur=1" onBlur="folderblur=0"></td>
<td width="50%" align="center" valign="top"><font style="font-size:14px">[<font id="newfolder"></font>] <a href="javascript:ShowFileAccessInfo()"><img src="GIF/upload.gif" width="20" height="20"></a></font></td>
</tr>
<tr>
<td valign="top" id="fileslist" style="font-size:14px">
文件列表: </td>
<td width="50%" height="301" valign="top" id="folderlist" style="font-size:14px">文件夹列表:
</td>
</tr>
<tr>
<td valign="top" id="typelist" style="font-size:14px">
<select name="select_typelist" onchange="document.all.fileslist.innerHTML=listfiles(filepaths,this.value)" onFocus="folderblur=1" onBlur="folderblur=0">
<option>文件类型列表</option>
<option value=".*">所有文件(*.*)</option>
<option value=".rjs" selected>renjs文件(*.rjs)</option>
</select>
</td>
<td valign="top" id="driverlist" style="font-size:14px">
<select name="select_driverlist" onFocus="folderblur=1" onBlur="folderblur=0">
</select></td>
</tr>
</table> <div align="center">
<script language="JavaScript" type="text/JavaScript">
function ShowFolderList(folderspec)
{
var f, fc, s;
f = fso.GetFolder(folderspec);
fc = new Enumerator(f.SubFolders);
s = "文件夹列表: <div style=\"position:relative ; left:-1px; top:0px; width:100%; height:90%; z-index:1;overflow: auto\">";
for (;!fc.atEnd(); fc.moveNext())
{
s+="<a href=\"javascript:changfolderlist('"+backlastname(fc.item())+"')\"><font style=\"background-color: ;color:#000000\" onmouseover=\"this.style.background='#9999FF';this.style.color='#FFFFFF';\"onmouseout=\"this.style.background='';this.style.color='#000000';\" >"+backlastname(fc.item())+"</font></a><br>"
}
s+="</div>"
return(s);
}function showdriveexit(init,typy){
var a=68;
var initd;
if(init=="")
initd="C:";
else
initd=init;
var s=" <select name=\"select_driverlist\" onChange=\"document.all.folderlist.innerHTML=ShowFolderList(this.value);document.all.fileslist.innerHTML=listfiles(this.value,document.openwritefiles.select_typelist.value);filepaths=this.value;\" onFocus=\"folderblur=1\" onBlur=\"folderblur=0\">"+"<option value=\""+initd+"\" selected>"+initd+"</option>";
for(;(fso.FolderExists(String.fromCharCode(a)+":"));a++)
{
s += " <option value=\""+String.fromCharCode(a)+":\">"+String.fromCharCode(a)+":"+"</option>";
}
s+="</select>";
document.all.driverlist.innerHTML=s;
document.all.folderlist.innerHTML=ShowFolderList(initd);
document.all.fileslist.innerHTML=listfiles(initd,typy) ;
return(s);
}
function backlastname(paths){
var s , st ;
s=paths+"";
if((st=s.lastIndexOf("\\"))!=-1)
{s=s.slice(++st,paths.length);return s;}
else return s}function listfiles(folderspec,types){
var f, fc, s , names , st , names_enlarge ;
f = fso.GetFolder(folderspec);
fc = new Enumerator(f.files);
s = "文件列表 <div style=\"position:relative ; left:-1px; top:0px; width:100%; height:90%; z-index:1;overflow: auto\">";
for (; !fc.atEnd(); fc.moveNext())
{
names=fc.item();
names+="";
st=names.lastIndexOf(".");
names_enlarge=names.slice(st,names.length)
if(names_enlarge==types||types==".*"){
s+="<a href=\"javascript:showfilename('"+backlastname(fc.item())+"')\"><font style=\"background-color: ;color:#000000\" onmouseover=\"this.style.background='#9999FF';this.style.color='#FFFFFF';\"onmouseout=\"this.style.background='';this.style.color='#000000';\">"+backlastname(fc.item())+"</font></a><br>"
}//if
}
s+="</div>"
return(s);
}
function showfilename(names){
document.openwritefiles.filename.value=filepaths+"\\"+names;
}
function changfolderlist(filenames){
filepaths+="\\"+filenames;
document.all.folderlist.innerHTML=ShowFolderList(filepaths);
document.all.fileslist.innerHTML=listfiles(filepaths,document.openwritefiles.select_typelist.value) ;
document.all.newfolder.innerHTML=backlastname(filepaths);
}function ShowFileAccessInfo()
{
var st ;
if ((st=filepaths.lastIndexOf("\\"))!=-1)
{
filepaths=filepaths.slice(0,st);
document.all.folderlist.innerHTML=ShowFolderList(filepaths);
document.all.fileslist.innerHTML=listfiles(filepaths,document.openwritefiles.select_typelist.value) ;
document.all.newfolder.innerHTML=backlastname(filepaths);
}
}
</script>
<input type="button" name="Button" value="确定" onClick="showfolder=0;document.all.dofiles.style.visibility='hidden';">
<input type="button" name="Submit2" value="取消" onClick="showfolder=0;document.all.dofiles.style.visibility='hidden';">
</div>
</form>
</div><p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<form name="form2" method="post" action="">
<textarea name="textfield2" onclick="this.value=ShowFolderList('c:\\winnt')"></textarea>
</form>
</body>
</html>
////////////////////////////////////////////////
大家看一看,小弟作的一个很简陋的文件浏览提示框。
为什么在本地可以浏览,但传到服务器上就不行了呢?
说是“automation 服务器不能创建对象”的错误