Import external Javascript in VBCS
Summary
Import external Javascript in VBCSContent
Hi,
I want to use JS (https://lindell.me/JsBarcode/) to generate bar code.
As per docs: https://lindell.me/JsBarcode/, we need to import JS and call function.
I have imported JS under Resources/js folder. I have attached code of how i am invoking the function on button click.
However i am getting error as: JsBarcode is not a function. Any hint where am i going wrong?
Code Snippet
define(["resources/js/JsBarcode.all.min.js"], function(JsBarcode) { 'use strict'; var PageModule = function PageModule() {}; PageModule.prototype.generateBarCode = function () { return JsBarcode("#barcode", "Hi!"); }; return PageModule; });
Tagged:
0