1
我已經寫了下面的代碼在javascript:如何使用FileSystem API的window.requestFileSystem?
javascript代碼:
var fs=null;
function initFS() {
window.requestFileSystem =window.requestFileSystem || window.webkitRequestFileSystem;
window.requestFileSystem (window.TEMPORARY, 1024 * 1024, function (filesystem) {
fs = filesystem;
}, errorHandler);
}
的html代碼:
<input type="button" id="button2" name="click" value="show" onclick="initFS();" />
但點擊在initFS function
顯示按鈕,行後後window.requestFileSystem (window.TEMPORARY, 1024 * 1024, function (filesystem) {
它將錯誤顯示爲「未捕獲類型錯誤」。我的代碼中有任何錯誤嗎?
@Shikha:你可以告訴控制檯打印 –
控制檯打印「FileError已被棄用,請使用‘姓名’或‘消息’屬性DOMError,而不是‘代碼’。 – Shikha
閱讀此答案http://stackoverflow.com/questions/24930403/writing-to-a-file-in-javascript-using-filesystem-api可能會幫助,而不是FileError使用名稱和消息屬性 –