function detectBarcode(dataUrl, callback) {
// call here your favorite javascript barcode scan library// input must be an image dataUrl// output must be a single String// don't forget to trigger the call back in order to get the resultcallback(barcode);
}
Import javascript files into your index.html
<script src="LINK_TO_MY_AWESOME_JAVASCRIPT_BARCODE_SCAN_LIB"></script>
<scriptsrc="js/barcode.js"></script>// the javascript file with the detectBarcode function