3uriah
Posts: 0
Joined: Tue Oct 08, 2013 9:21 am

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

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

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

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

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"

3uriah
Posts: 0
Joined: Tue Oct 08, 2013 9:21 am

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

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

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

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

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

3uriah
Posts: 0
Joined: Tue Oct 08, 2013 9:21 am

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

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?

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

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

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.

Return to “Issues”