嗨,这是我的第一篇文章,但我一直在尝试从这里使用 Screenshot 插件: https ://github.com/phonegap/phonegap-plugins/tree/88a57e1c232f604f73be5bd82868d711ac235424/Android/Screenshot
我得到这个错误:Uncaught TypeError: Cannot call method 'SaveScreenshot' of undefined at file ...而且我真的不知道为什么它给我一个错误!欢迎任何帮助
这是调用该方法的JS:
document.addEventListener("deviceready", onDeviceReady, false);
// PhoneGap is ready
//
function onDeviceReady() {
$('#saveBtn').click(function(){
window.plugins.Screenshot.saveScreenshot();
});
}
这是按钮的 html
<button id="saveBtn">Save</button><br>
我已经获取了 Screenshot.js 文件和所有内容
编辑:如果有帮助,我正在使用 Cordova 2.0.0,并且我正在使用为同一版本的 Cordova 编码的插件 Screenshot