I added a .js file to my Blazor project and everything is ok. However there is a “Self-Invoking Function” in my .js file. How could I tell my app to run it as a self-invoking function?
In index.html:
<script type="module" src="common.js"></script>
In Index.razor:
module = await JS.InvokeAsync<IJSObjectReference>("import", "./common.js");
New contributor
backspace is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2