Let's Reconnect, thank you for making 2022 our best year yet.

Look Back
Import external Javascript in VBCS — Cloud Customer Connect
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Import external Javascript in VBCS

Accepted answer
edited Jan 4, 2021 3:27PM in Visual Builder 8 comments


Import external Javascript in VBCS



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;

Howdy, Stranger!

Log In

To view full details, sign in.


Don't have an account? Click here to get started!