Browsers don't see javascript.



  • For losing the code from the editor Brackets - it's working, it's called.
    But if you try to open it index.html In the browser and cause an event, the browser reports a mistake - the function has not been found. What I didn't try and what kind of turf didn't put into the league. script Nothing helps, but Yandex works, all the other browsers don't see function or violin.

    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);
    }</code></pre><pre class="snippet-code-css lang-css prettyprint-override"><code>    #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;
    
    }</code></pre><pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
    

    <head>
    <link rel="stylesheet" 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>



  • You can just call a function right out of the jscons. or

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

    in file galaryjs.js

    If both options do not work, the way to the galaryjs.js file is wrong.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2