Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a QR code reader in a HTML5 website? [closed]

I was looking for possibility to create QR code reader in my HTML5 based web page. I've done some googling and all the links point me to the mobile applications.

Please help me with some pointers as to how I can use HTML5 and JavaScript to read a QR code containing a url and then redirect the browser to that URL.

like image 307
Binay Avatar asked Jul 24 '12 06:07

Binay


People also ask

Can you make a website only accessible by QR code?

You can't ensure that the URL came from scanning the QR code, that isn't possible. QR codes are just a method of encoding text, once the user knows the text they can do whatever they want with it. You can, however, restrict the usefulness of the QR code so even if it is leaked it isn't useful.

How do I scan a QR code to open a website?

How to use the QR code reader. Tap the search bar. Above the keyboard, tap the Scan icon. After scanning you will see the web address, tap Allow to visit the site.


2 Answers

There aren't many JavaScript decoders.

There is one at http://www.webqr.com/index.html

The easiest way is to run ZXing or similar on your server. You can then POST the image and get the decoded result back in the response.

like image 135
Terence Eden Avatar answered Oct 18 '22 18:10

Terence Eden


The jsqrcode library by Lazarsoft is now working perfectly using just HTML5, i.e. getUserMedia (WebRTC). You can find it on GitHub.

I also found a great fork which is much simplified. Just one file (plus jQuery) and one call of a method: see html5-qrcode on GitHub.

like image 16
prespic Avatar answered Oct 18 '22 20:10

prespic