android - phonegap 使用文件选择器 corodova
问题描述
我是一个新的 phonegap 开发人员,我尝试使用 corodova 插件,所以我像这样安装它
cordova plugin add cordova-plugin-chooser
它安全地安装了它,然后我像这样将它导入到我的phonegap应用程序中
<plugin name="cordova-plugin-chooser" />
我收到错误
refernceerror filepicker is not defined
这是我的代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>stop studio</title>
</head>
<body>
<div class="center">
<lu>
<li>
<button id="newp" onclick="ff()"><h1>new f photo</h1></button>
</li>
<li>
<button id="newv" ><h2>new video</h3></button>
<button id="save" background-color="green"><p>save</p><button>
</li>
</lu>
<p id="hi">fuc</p>
</div>
<style>
#newv{
background-color:#f26d49;
}
#save{
background-color:#7340c9;
}
#newp{
background-color:#3dffff;
}
li{
list-style-type: none;
}
.center{
margin: auto;
width: 50%;
border: 3px solid green;
padding: 10px;
}
</style>
<plugin name="cordova-plugin-chooser" />
<script>
function ff()
{
try {
FilePicker.pickFile(successCallback,errorCallback);
function successCallback(path) {
alert("You picked this file: " + path);
}
}
catch(error) {
alert(error);
// expected output: ReferenceError: nonExistentFunction is not defined
// Note - error messages will vary depending on browser
}
alert("hi");
}
</script>
<script type="text/javascript" src="cordova.js"></script>
</body>
</html>
解决方案
推荐阅读
- excel - 粘贴功能修改其他工作表
- python-3.x - Pytorch DataLoader 多数据源
- unity3d - 根据屏幕尺寸调整 3D 游戏
- javascript - 带画布的图案背景文本
- sql - SQL Server 探查器。持续时间:18446744073709547 微秒
- javascript - NativeScript - viewModel.foo 和 viewModel.get("foo") 有什么区别?
- android - ConstraintLayout 行为从 1.1.2 到 1.1.3 的奇怪变化
- angular - 来自组件的 Angular 单元测试 spyOn 服务
- pandas - 获取特定日期数量的标准偏差
- c++ - 如果在一个while循环内导致麻烦