我们正在尝试在我们的移动网络应用中整合条形码扫描器的phonegap插件。任何人都可以帮助我整合这个吗?如何在移动web应用程序中为条形码扫描器集成Phonegap插件?
我说,Phonegap.js和cardova.js,插件尝试安装,但它需要太多的时间,而不是安装..
这里是我的HTML内容
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Bar code Reader</title>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="barcodescanner.js"></script>
<script src="cordova.js"></script>
<script>
$(document).ready(function() {
app.initialize();
});
function clickScan() {
console.log("I am now scanning");
window.plugins.barcodeScanner.scan(function (result) {
alert("We got a barcode\n" +
"Result: " + result.text + "\n" +
"Format: " + result.format + "\n" +
"Cancelled: " + result.cancelled);
}, function (error) {
alert("Scanning failed: " + error);
});
}
</script>
</head>
<body>
<button id="scan" style="padding: 10px;" onclick="clickScan">Scan!</button>
</body>
</html>
链路github上用于条形码扫描器的PhoneGap插件? –