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!