Question

2
Replies
1568
Views
JorgeR10 Member since 2014 8 posts
Cognizant
Posted: December 19, 2018
Last activity: December 19, 2018
Closed

Call Javascript function from HTML fragment

Hello,

I am trying to call a Javascript function (which is defined on a Text File, OOTB from Pega Call) from an HTML Fragment that I have defined, inside the <script> tags.

The problem I face is that, everytime I try to execute it, the response is that some other function is not defined, for example, there is a "sendError" function inside the code of the function that I need to call, and it says when I test it: "sendError is not defined". If I copy/paste the definition of sendError to my code, the same will happen for many more functions, basically every function referenced anywhere on the code.

I tried to copy the definition of all the referenced functions, but in the end there was some for which I could not find the definition anywhere. I tried to include the other text files as <script src="webwb/filename.js">, but it didn't make any difference.

Anyone can tell me what would be the correct way to call the function from my HTML Fragment? I might be missing some way to include the other JS files on my code, so that I can freely use its functions.

Thanks for the help!

Low-Code App Development Data Integration Java and Activities
Moderation Team has archived post
Share this page LinkedIn