我們正在嘗試在我們的移動網絡應用中整合條形碼掃描器的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插件? –