如何使用Java腳本打印文件夾內的所有txt文件我需要使用javascript從HTML內的目錄中打印所有txt文件。我試圖修改處理照片的代碼,但未成功如何使用Jquery / Javascript將文件夾中的所有圖像加載到網頁中var dir = "D:\Finaltests\test1\new\places";var fileextension = ".txt";$.ajax({
//This will retrieve the contents of the folder if the folder is configured as 'browsable'
url: dir,
success: function (data) {
//List all .txt file names in the page
$(data).find("a:contains(" + fileextension + ")").each(function () {
var filename = this.href.replace(window.location.host, "").replace("http://", "");
$("body").append("<input type='file' onload='readText(" + dir + ")>");
});
}});
如何使用Java腳本打印文件夾內的所有txt文件
有只小跳蛙
2019-09-26 15:23:49