その現在のすべてのhtmlファイルを直接検索div
し、ハイパーリンクでタグに追加します..IEでは完璧に機能します..しかし、FirefoxとChromeでは機能しません..誰もが私を助けることができます....
<script type="text/javascript">
function getCurrentDirectory() {
var fso = new ActiveXObject("Scripting.FileSystemObject");
path = unescape(document.location);
path = path.substring(8, path.lastIndexOf("/") + 1);
return path;
}
function ShowFolderFileList() {
var fso, f, f1, fc, s, temp, Extention, fileName, temp2, filePath;
folderspec = getCurrentDirectory();
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFolder(folderspec);
fc = new Enumerator(f.files);
s = "";
for (; !fc.atEnd(); fc.moveNext()) {
filePath = "" + fc.item() + "";
fileName = fc.item().name;
temp = "" + fileName + ""
Extention = (temp.lastIndexOf(".") > -1) ? temp.slice(temp.lastIndexOf(".") + 1).toLowerCase() : "*";
if (Extention == "html" || Extention == "htm") {
s += "<a href=\"" + fileName + "\" target=\"_blank\">" + temp.replace("." + Extention, "") + "</a> <br>";
}
}
outPut.innerHTML = s;
}
</script>
htmlで
<div id="outPut">
</div>
誰もがこれに取り組んでいます....