问题描述
我正在尝试Firefox,IE 9,Chrome和Opera下面的代码,但是onInitFs(fs)函数没有被调用。如果我在window.requestFileSystem(window.PERSISTENT)中的onInitFs中添加'()' ,1024 * 1024,onInitFs,errorHandler)函数被调用,但fs为空?
有谁知道如何解决这个问题?我试试Windows 7.我非常感谢你的帮助。
I am trying on Firefox,IE 9,Chrome and Opera the code below ,but the onInitFs(fs) function doesn't get called.if I add '()' to onInitFs in the window.requestFileSystem(window.PERSISTENT, 1024*1024, onInitFs, errorHandler) that function get called but fs is null ?Does anybody know how to solve this problem?I try on windows 7.I'll appreciate very much your help.
<!DOCTYPE HTML>
`<html>
<head>
<script>
function errorHandler(e){
alert("errorrrr");
}
function onInitFs(fs){
alert("onInitFs");
}
function readClick(){
if (window.webkitRequestFileSystem) {
window.webkitRequestFileSystem(window.PERSISTENT, 1024*1024,onInitFs,errorHandler);
}
else {
window.requestFileSystem(window.PERSISTENT, 1024*1024, onInitFs, errorHandler);
}
alert("read finishsssss");
}
</script>
</head>
<body>
<input type="button" value="Read dir" onclick="readClick()">
<ul id="filelist"></ul>
</body>
</html>
推荐答案
只有chrome支持 requestFileSystem
作为 webkitRequestFileSystem
版本。
Only chrome supports requestFileSystem
as the webkitRequestFileSystem
version.
没有其他浏览器(FF6,IE9,Op11) )支持这个
None of the other browsers (FF6, IE9, Op11) support this
这篇关于window.requestFileSystem无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!