0
我的目標:我需要閱讀txt文件使用FSO - 的ActiveX然後單獨的文本;並將每個分隔的單詞放在select - 選項中。 到目前爲止,我得到了這一點,但AINT工作使用ActiveX單獨讀取文件;並放在選擇 - 選項
<script>
function readAll() {
var fso = new AcitveXObject("Scripting.FileSystemObject");
var txtFile = fso.OpenTextFile("kategorije.txt", 1, false, 0);
var fText = txtFile.ReadAll();
txtFile.Close();
}
var array = fText.split(";");
var sel = document.getElementById("dropdown2");
for (var i = 0; i < dropdown2.length; i++) {
var opt = document.createElement("option");
opt.innerHTML = fText[i];
opt.value = fText[i];
sel.appendChild[opt];
}
</script>