答案:<SCRIPT language=javascript src="pict/datas.ini"></SCRIPT>
<script language=javascript>
var s="";
for(var i = 0; i < datas.length ; i++){
s+=datas[i]+"||||";
}
document.write(s);
</script>
<script language="javascript">
function init(){
var fso = new ActiveXObject("Scripting.FileSystemObject");
var folder = fso.GetFolder("pict");
var datas = fso.CreateTextFile("pict/datas.ini",true);
datas.WriteLine("var datas = new Array();") ;
var fenum = new Enumerator(folder.Files);
for (var i = 0 ; !fenum.atEnd(); fenum.moveNext(),i++){
datas.WriteLine("datas["+ i +"] = \""+ fenum.item().Name +"\";") ;
}
datas.Close();
//var f1 = fso.GetFile("pict\\a.txt");
for(var file in folder.Files){
alert(file);
//alert("File last modified: " + file.DateLastModified);
}
}
</script>
<input type="button" value="初始化数据" onclick="init()">
上一个:翻译整理的jQuery使用查询手册
下一个:禁止F5等快捷键的JS代码