繁体   English   中英

科尔多瓦文件插件不起作用

[英]Cordova file plugin doesn't work

我在我的项目中使用cordova 5.1.1 我在cordova_plugins.js中有文件插件的声明:

{
    "file": "plugins/cordova-plugin-file/www/FileSystem.js",
    "id": "cordova-plugin-file.FileSystem",
    "clobbers": [
        "window.FileSystem"
    ]
},

但是当我尝试使用这样的插件时:

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
        onFileSystemSuccess, fail);

我得到:

Uncaught ReferenceError: LocalFileSystem is not defined

没有响应侦听器,因此未加载文件插件,这就是为什么

Uncaught ReferenceError: LocalFileSystem is not defined

添加它,并在其中包含您的请求:

document.addEventListener("deviceready", function() { 
  //use request file here
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
        onFileSystemSuccess, fail);
}, false);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM