Reference WebResources from HTML

Hello there,

what I am trying to do is the following: I have developed a pure HTML/CSS/JS webapp, which I want to integrate into confluence as a macro. The execute method of my macro currently just returns the html page, which I developed earlier. I tried to supply it with the necessary stylesheets and javascript, by adding them as a webresource into atlassian-plugin.xml.
But here lies my problem: By now I couldn’t figure out, which URL to use for referencing the stylesheet/javascript files in my HTML. I tried different variants of relative/absolute paths to the resource, but none of them seems to work.
So this is my question: Is it even possible to reference those resources from a static HTML page, or do I have to use Velocity templates? I was trying to avoid this, because the application is currently working perfectly well, and I just wanted to migrate it into a confluence plugin without changing too much.
So if it’s possible to use these resources from static html, please let me know. If not, just tell me, I’m going to use the velocity templates then. But it would be kind of a bummer, because I’d have to learn it from scratch.

Thanks in advance and have a nice day! :slight_smile:

@laszlo.stark apparently there is a AJS.loadWebResourceTemplates which allows you to dynamically load a web resource client-side. I can’t find any documentation for it, but it is referenced here: https://community.atlassian.com/t5/Answers-Developer-Questions/Load-Web-Resource-with-Javascript/qaq-p/507561