Include external javascript when developing macro

I’m developing a macro, and I need to use a javascript file from thirdparty.
Could you please let me know how to complete this?

1 Like

you can download it and create a web-resource

1 Like

The external file is managed by third party so I cannot download it

I fail to understand. You choose a version and develop against it. You can’t just take the latest every time, things will break. You treat it like any dependency. Either you download a specific version and store it with your code and create a web-resource or you add one of the many javascript tools to your build to fetch it and package it with known name and create a web-resource.

If there is a better way I’d be interested to hear it.

1 Like

Hi,
You can do this If you really don’t wan to download the js but I don’t think it’s a good practice.
Like @justin_shapiro said. It will break.
Create a simple .js file with document.write() and include it in your web-resource.

Js example:

document.write(
  "<script src='http://url-to-your-third-party.js'></script>"
);

There are few others way.
You can use jquery too to achive this .
https://api.jquery.com/jquery.getscript/