I have page1.html which uses blah.js. One of the things blah.js does is run a function1() when the page is loaded. I would like to use function2() from blah.js in page2.html without blah.js running function1(). I thought I could add
export {function2}
to blah.js and then just import function2() by adding
<script type = "module">
import { function2 } from './blah.js'
</script>
to page2.html. But this seems to have the same functionality as if I just imported the file as normal:
<script defer src="blah.js"></script>
i.e. function1() runs in page2 in both cases. How can I get access to function2() without running the other parts of blah.js?
function2into another file and have both pages import itblah.jsso it doesn't runfunction1when loaded. Instead have page1 callfunction1manually