我正在 Firefox、IE 9、Chrome 和 Opera 上尝试下面的代码,但是 onInitFs(fs) 函数没有被调用。如果我将 '()' 添加到 window.requestFileSystem(window.PERSISTENT, 1024* 中的 onInitFs) 1024, onInitFs, errorHandler) 该函数被调用但 fs 为 null ?
有人知道如何解决这个问题吗?我在 Windows 7 上尝试。非常感谢您的帮助。
<!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>
仅镀铬支持requestFileSystem
as the webkitRequestFileSystem
版本。
其他浏览器(FF6、IE9、Op11)均不支持此功能
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)