I am loading an HTML as a Modal and it has its own JavaScript file, and a couple libraries I am using calling them with CDN, but none of the scripts are loading only the HTML and CSS.
If someone know how can I load the scripts, I'll appreciate it, sorry if the explanation is not the best.
JS of the main html
cardPickerBtn.addEventListener('click', () => {
vpModal.style.display = 'block'
document.getElementById('slider-main').style.display = 'none'
const request = new XMLHttpRequest();
request.open('GET', 'page 8(cards).html');
request.onload = function() {
vpModal.innerHTML = request.response;
};
request.send();
});
Modal HTML scripts
<script src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js"></script>
<script src="https://unpkg.com/imagesloaded@5/imagesloaded.pkgd.min.js"></script>
<script src="page 8(masonery).js" type="module" async></script>