我试图在windows phone 7上实现条形码扫描器插件。根据插件的自述文件执行以下步骤:
1.将dll添加到我的项目。
2.将barcodescanner.js添加到'www'文件夹,并将js文件包含在我的'index.html'中。
3.将BarcodeScanner.cs添加到我的项目中。Windows Phone 7上的条形码扫描器phonegap/cordova插件
我没有找到任何指导在windows phone平台上实现这一点,所以我尝试使用this指南,这是为Android编写使用插件的html/js。我已经inlcuded一个按钮的onclick其所称的“扫描()”函数:
function Scan() {
window.plugins.barcodeScanner.scan(
function(result) {
alert("Scanned Code: " + result.text
+ ". Format: " + result.format
+ ". Cancelled: " + result.cancelled);
}, function(error) {
alert("Scan failed: " + error);
});
}
在运行应用程序,并单击该按钮时,我发现了以下错误在控制台窗口:
Error:"Unable to get value of the property 'barcodeScanner': object is null or undefined file:x-wmapp1:/app/www/index.html Line:45"
我如何得到这个工作?