< Previous Article Next Article >

pjs.call()

The pjs.call() API calls another Profound.js module. The module is loaded with the pjs object injected, so you have access to the pjs API, and the function designated with exports.default is then called.

The first parameter is the name of the Node.js module. Subsequent parameters are passed as arguments to the exports.default function.

display.orderInquiry.execute();

if (btnViewCustomer) {
  pjs.call("displayCustomerModule.js", customerNumber);
}

if (btnEditOrder) {
  pjs.call("editOrderModule.js", orderNumber, customerNumber);
}

If the exports.default function returns a value, this value is also returned from pjs.call().

Questions?

Have questions about this topic? Ask for help on our Profound.js Spaces Discussion Forum.

< Previous Article Next Article >