How to call a JavaScript function from another external file

Hi,

I have an external file with my JavaScript functions.
Is it possible to call the function from another external file ?

Thanks in advance.

Hello @Vladimir.Bazgan,

You can load any external script on the form using RequireJS library. Please find the example in this article.

Thanks.

I tried with RequireJS, but I see that it is working asynchronously. Do you know how to wait the response from the function I called?

I resolved my issue with $.ajax:

  $.ajax({
          async: false,
          url: "http://intranet/procese/DocJS/Utils.js",
          dataType: "script"
   });
1 Like