我试图在Firefox,IE 9,Chrome和Opera下面的代码,但是onInitF(fs)函数没有被调用.如果在window.requestFileSystem(window.PERSISTENT,1024 *)中添加'()’到onInitF,1024,onInitFs,errorHandler)函数get被调用,但fs为null?
有没有人知道如何解决这个问题?我尝试 windows 7.我非常感谢你的帮助.
有没有人知道如何解决这个问题?我尝试 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,errorHandler);
}
else {
window.requestFileSystem(window.PERSISTENT,errorHandler);
}
alert("read finishsssss");
}
</script>
</head>
<body>
<input type="button" value="Read dir" onclick="readClick()">
<ul id="filelist"></ul>
</body>
</html>
解决方法
只有chrome支持requestFileSystem作为webkitRequestFileSystem版本.
没有其他浏览器(FF6,IE9,Op11)支持此功能