[英]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.