Link HTML file in OSC with custom module

I could just be blatantly ignorant but I cant seem to figure out how to access functions in an html script from either a custom module or OSC in general? Is there any standard way in OSC to access an html file?

I have tried submodules from cm's but ofc its not a js script so it doesnt load and errors after finding "<", granted I didnt expect it to work since it needs modules.exports anyways for submodules.

I'm not sure to understand the use case, but you can't load an external html file in the client and access its scripts from widget scripts (nor from the custom module).

The use case is basically that the html file is displaying something in a frame widget and I'd like to be able to update / change whats shown on the frame by accessing a function to update in the html file. I assumed that external html files couldnt be loaded but wanted to ask. Thankyou!