I'm trying to load html using jqyery. That HTML includes a js file, and every time I try to load it it doesn't execute js file included in it. But when I write the script inside the html page it works fine.
What doesn't work:
<link rel="stylesheet/less" href="/categories/categories.less">
<div id="categories">
</div>
<script type="module" src="/categories/categories.js"></script>
What does work:
<link rel="stylesheet/less" href="/categories/categories.less">
<div id="categories">
</div>
<script >
console.log('categories has been loaded');
</script>