title: Is Javascript is linked Dynamically or statically with the html?
body: <p>As per my research in context of Java
  If a class "A.java" is dependent on some function present in library file B.jar. It is said to be dynamically linked. because code in B.jar gets linked to the "A.java" at runtime producing executable.</p>
  
  <p>Statically linked means the the code in B.jar is brought and compiled with the "A.java" before runtime.</p>
  
  <p>But how does we should look at it when it comes to "C.html" and "D.js". How both are combined?</p>
  
  <p>As working of <strong>V8</strong> engine says it has 2 compilers which at the end spits out optimized version of the "D.js" code. How this gets along with the "C.html"?</p>
  
  <p>Consider "C.html" has </p>
  
  <pre><code>//Link D.js file 
  &lt;script type="text/javascript" src=**"D.js"**&gt;&lt;/script&gt;
  // loadDoc() is defined inside D.js file
   &lt;button type="button" onclick="loadDoc()"&gt;Change Content&lt;/button&gt;
  </code></pre>
  
  <p>Assume D.js file defines the loadDoc()</p>
  
  <pre><code> function loadDoc() {
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
     if (xhttp.readyState == 4 &amp;&amp; xhttp.status == 200) {
     document.getElementById("demo").innerHTML = xhttp.responseText;
    }
    };
   xhttp.open("GET", "ajax_info.txt", true);
   xhttp.send();
   }
  </code></pre>
  
  <p>Now this D.js is liked statically or dynamically?</p>