Java Script Control Resource

I followed this web page to add my library js file.

https://documentation.decisions.com/docs/javascript-control-using-library

When I run the debug, it always says "Error loading ExampleJSLibrary". So I wonder, does this code correct? Is the path of virtualPath + "/scripts/FormControls/jsFiles/ExampleJSLibrary.js" correct? I cannot find my js library file with this path.


ExampleJSLibrary.prototype.initialize = function (host, component) {

 // here "virtualPath" is a global variable in the Decisions client

 $DP.ScriptLoader.LoadScript(

  virtualPath + "/scripts/FormControls/jsFiles/ExampleJSLibrary.js"

 )

  .then(function () {

   // Do initialization of your data control which that depends on the 3rd party library

  })

  .catch(function (e) {

   console.error("Error loading ExampleJSLibrary", e);

  });

};

Comments

Sign In or Register to comment.