Page 2 of 2

Barcode Scanner: How to open up url upon scan completion.

Posted: Sun Oct 13, 2013 12:14 pm
by 3uriah

Sorry I've been busy with some other projects. Yes I did, unfortunately it doesn't seem to work :/ Here is a pic, is this what you had in mind? Image Image


Barcode Scanner: How to open up url upon scan completion.

Posted: Sun Oct 13, 2013 1:20 pm
by Igor

Hello,

Replace code:
pre
window.open(data.text, '_system', 'location=yes');
/pre

with next one:
prewindow.open('' + data.text +'', '_system', 'location=yes');/pre

You should use quotation marks with "data.text"


Barcode Scanner: How to open up url upon scan completion.

Posted: Sun Oct 13, 2013 2:17 pm
by 3uriah

Still no luck. Is it possible that it's not working because I'm running the program through the appery android tester app?


Barcode Scanner: How to open up url upon scan completion.

Posted: Sun Oct 13, 2013 2:21 pm
by Igor

It shouldn't, but you could try to export .apk file and test it.


Barcode Scanner: How to open up url upon scan completion.

Posted: Sun Oct 13, 2013 2:31 pm
by 3uriah

what exactly is data.text? I assumed its purpose is to take whatever text my barcode scanner picks up from a QR code (i.e. a url) and inputs it into window.open().

i.e. so if I scan a QR code that has url: http://www.google.com, data.text will use that scanned url, thereby allowing window.open() to open the link.

perhaps I am missing something in the components section? do I need to route the 'text' in responses to a local storage variable?


Barcode Scanner: How to open up url upon scan completion.

Posted: Sun Oct 13, 2013 9:17 pm
by Igor

You are right, data.text this is text from barcode scanner. Please make sure that data.text enclosed in single quotes instead of double quotes.