I've got a working PhoneGap app that I'm trying to add a QR scanner to. To do this, I'm using PhoneGap Build's BarcodeScanner plugin. The issue that I'm having is that upon a scan completing, an alert will cause the app to freeze.
The relevant JavaScript is
var options=""
options += '<p>'+formData["form"][formPart][1]+'</p>'
options += '<a data-role="button" data-rel="dialog" formPart="'+formPart+'"id="Cap-'+formPart+'">Capture Image</a>'
options += '<p id="Cap-Data"></p>'
$('#formContent').append(options);
$('#Cap-'+formPart).on("tap",function(event){
var scanner = cordova.require("cordova/plugin/BarcodeScanner");
scanner.scan(
function (result) {
var FP = $(this).attr("formPart");
$('#Cap-Data').html(result.text);
alert(result.text);
},
function (error) {
alert("Scanning failed: " + error);
}
);
});
Any help on this would be much appreciated.