javascript – window.requestFileSystem不工作

前端之家收集整理的这篇文章主要介绍了javascript – window.requestFileSystem不工作前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图在Firefox,IE 9,Chrome和Opera下面的代码,但是onInitF(fs)函数没有被调用.如果在window.requestFileSystem(window.PERSISTENT,1024 *)中添加'()’到onInitF,1024,onInitFs,errorHandler)函数get被调用,但fs为null?
有没有人知道如何解决这个问题?我尝试 windows 7.我非常感谢你的帮助.
  1. <!DOCTYPE HTML>
  2. `<html>
  3. <head>
  4. <script>
  5. function errorHandler(e){
  6. alert("errorrrr");
  7. }
  8. function onInitFs(fs){
  9. alert("onInitFs");
  10. }
  11. function readClick(){
  12. if (window.webkitRequestFileSystem) {
  13. window.webkitRequestFileSystem(window.PERSISTENT,1024*1024,errorHandler);
  14. }
  15. else {
  16. window.requestFileSystem(window.PERSISTENT,errorHandler);
  17. }
  18.  
  19. alert("read finishsssss");
  20. }
  21. </script>
  22. </head>
  23. <body>
  24. <input type="button" value="Read dir" onclick="readClick()">
  25. <ul id="filelist"></ul>
  26. </body>
  27. </html>

解决方法

只有chrome支持requestFileSystem作为webkitRequestFileSystem版本.

没有其他浏览器(FF6,IE9,Op11)支持功能

猜你在找的JavaScript相关文章