JQuery QR Code Scanner using Instascan JS Example
Are you looking for qr code scanner script using jquery html5? If yes then i will defiantly help to create simple example for qr code or barcode reader using webcam or mobile camera. we will use instascan js plugin for qr code scan.
Instascan JS is a real-time webcam-driven HTML5 QR code scanner. Instascan JS wil help to find all camera attach with your system or mobile and you can read barcode using anyone that you want.
So, basically, you have to copy bellow html code and run in your system. Then i also attach qr code for demo. So let's see.
Index.html
<!DOCTYPE html>
<html>
<head>
<title>JQuery HTML5 QR Code Scanner using Instascan JS Example - ItSolutionStuff.com</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://rawgit.com/schmich/instascan-builds/master/instascan.min.js"></script>
</head>
<body>
<h1>JQuery HTML5 QR Code Scanner using Instascan JS Example - ItSolutionStuff.com</h1>
<video id="preview"></video>
<script type="text/javascript">
let scanner = new Instascan.Scanner({ video: document.getElementById('preview') });
scanner.addListener('scan', function (content) {
alert(content);
});
Instascan.Camera.getCameras().then(function (cameras) {
if (cameras.length > 0) {
scanner.start(cameras[0]);
} else {
console.error('No cameras found.');
}
}).catch(function (e) {
console.error(e);
});
</script>
</body>
</html>
You can also check this qr code:
I hope it can help you....
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- JQuery Rotate Image Animation Example Code
- JQuery Ajax CRUD Operations in PHP MySQL Example
- How to Remove All Spaces from String in JQuery?
- Bootstrap Star Rating using Bootstrap-star-rating JS Example
- PHP Ajax Inline Editing using X-editable Bootstrap JS Example
- Laravel Ajax Crop Image Before Upload using Croppie JS
- Bootstrap Multiselect Dropdown in Popup Example
- Laravel Notification Alert using Bootstrap Notify Plugin Example
- Bootstrap Lightbox Plugin Example Code
- How to Get the Current URL using JQuery?
- JQuery Tooltip Example using JQuery UI Plugin
- JQuery Timepicker with AM PM Format Example
- How to Redirect Another Web Page in JQuery?
- How to Get Max Attribute Value in JQuery?