【发布时间】:2017-06-17 07:42:27
【问题描述】:
我正在尝试在我的代码中实现 jquery 文件下载,但它没有按预期工作我使用本地系统作为我的文件系统来下载文件有人可以帮助我吗?我是 jquery 的新手,或者提供一个工作代码.
$(document).on("click", "a.fileDownloadSimpleRichExperience", function () {
$.fileDownload($(this).prop('href'), {
preparingMessageHtml: "We are preparing your report, please wait...",
failMessageHtml: "There was a problem generating your report, please try again."
});
return false; //this is critical to stop the click event which will trigger a normal file download!
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<a href="E://Download/Anshuman.txt" class="fileDownloadSimpleRichExperience">Download</a>
</body>
</html>
【问题讨论】:
-
控制台上的任何错误消息??
标签: jquery