My starting point for scanning from a web app was this article here Then i realized it was as simple as clicking a link like this
http://zxing.appspot.com/scan?req=http%3A%2F%2FLOCAL_SERVER_NAME%2FMY_APP_NAME%2FMY_SERVLET%3Fcode%3D%7BCODE%7D
but it didn't work.
My web app is simple like this (using ajax from jquery)
$("#onebutton").click(function(){
$.ajax({
url: "http://zxing.appspot.com/scan",
success:function(){
alert("success");
},
error:function(){
alert("error");
},
data:{
req:"http%3A%2F%2F192.168.1.100:8080%2FMY_APP_NAME%2FMY_SERVLET%3Fcode%3D%7BCODE%7D"
}
});
});
needless to say that "#onebutton" is a button tag with that id. When Pressing such button on a browser in android it always alerts the error message. It doesn't ask for the scanner to start up. When i click the button in a normal PC, the console says:
"Origin http://192.168.1.100:8080 is not allowed by Access-Control-Allow-Origin".
Am i doing something wrong?. Am i missing something?
Thank you all in advance!!