Problems with loading modal in Safari, Firefox and on Smartphone

  • I have a wierd situation, where my webpage used to lad just fine, before I put it online with hosting and domain. Now the Modal, that's supposed to popup on click, takes so long to load, that it undermines the whole purpose of the page. And so it's a real problem. At this point it seems to lad just fine in chrome though.

    I have tried several things, for example thoroughly checking my FTP-client, deleting, editing code, re-uploading but at this point, nothing has worked. Can anyone offer some infight as to where I go wrong?

    window.onload = function() {
        const span = document.querySelectorAll(".PopUp");
        span.forEach(LIelm => {
            LIelm.addEventListener('click', showHideModal)
    function showHideModal(e) {
        const projectNode =;
        if (!projectNode.matches('.Project, .modal-content')) return;
        if (projectNode.matches('.Project')) {
            document.getElementById(projectNode.dataset.modal).style.display = "block";
        } else {
   = "";
        <link rel="stylesheet" href="">
        <script src=""></script>
        <script src=""></script>
        <script src=""></script>
        <link rel="stylesheet" type="text/css" href="stylesheet.css">
        <script src="ModalPopUp.js"></script>
        <div class="content">
            <ul style="list-style: none;">
                <li class="Project" data-modal="myModal_1">
                    <span id="myBtn_1">
                        Lirma Type
                    <span id="year">
                    <div class="Describtion">
                        <span class="PopUp">Images</id>
                    <div id="myModal_1" class="modal">
                        <div class="modal-content">
                            <div id="demo" class="carousel slide" data-ride="carousel">
                                <!-- The slideshow -->
                                <div class="carousel-inner">
                                    <div class="carousel-item active">    
                                        <img src="Images/Lirma/type.jpg" alt="img" width="100%">
    <script src="ModalHide.js"></script>
    <script src="pExpand.js"></script>

  • Try to create a vanilla sandbox and then share the link with us.

    Let me know if you need help on how to do that.