browsers do not see the javascript file (only the program for writing the code sees)

Question:

When playing the code from the Brackets editor, everything works, the functions are called.
But if you try to open index.html in a browser and trigger an event, the browser reports an error – the function was not found. What I have not tried and what information I have not put into script tags – nothing helps, only Yandex works, all other browsers do not see the function or scripts.

The code:

function img_up(arg_src){
var div_all = document.createElement('div'); 
 div_all.id="div_all_id";        
document.body.appendChild(div_all);
        
var div_tx = document.createElement('div');
        div_tx.id="div_image";     
        document.body.appendChild(div_tx);
      div_tx.innerHTML="<img src="+" ' "+arg_src+" ' "+" onclick='img_dw()' >";
    }
                
                 function img_dw(){
    var remel=document.getElementById("div_image");
    remel.parentNode.removeChild(remel);
                     
    var rem_ove=document.getElementById("div_all_id");
    rem_ove.parentNode.removeChild(rem_ove);
    }
    #div_all_id{
    
        position:fixed;
        width: 100%;
        height: 100%;
        background: black;
        opacity: 0.7;
    }
    
    #div_image{
    
        position:fixed;
        background: black;
        color: red;

    } 
    #div_image img{
                    position:fixed;
        padding-left: 10%;
        padding-right: 10%;
        padding-top: 5%;
                    width: 80%;
    } 

    #galary{

    position: absolute;

    }
        #galary img{

    width: 200px;

    }
<html>
<head>
 <link href="galary.css" type="text/css" media="screen">
 <script type="text/javascript" src="galaryjs.js"></script>
    </head>
    <body>

<div id="galary">
       <img src="1.jpg" onClick="img_up(src)" >
       <img src="2.jpg" onClick="img_up(src)" >
  
</div>
        
</body>
</html>

Answer:

You can simply call the function directly from the js console or execute

console.log('файл js подключен');

in galaryjs.js file

If both options do not work, then the path to the galaryjs.js file is incorrect.

Scroll to Top