title: javascript - adding two script tags (in body) before continue another code from same js file
body: <p>How do I modify the below code? I would like to load exactly <strong>two</strong> scripts before adding next code from function <code>yourCodeToBeCalled</code>. Can someone give a hint for a beginner? I gave my suggestions after comment //.</p>
  
  <pre><code>var loadJS = function(url, implementationCode){//url, url_Next
      //url is URL of external file, implementationCode is the code
      //to be called from the file, location is the location to 
      //insert the &lt;script&gt; element
  
      var scriptTag = document.createElement('script');//will add scriptTag_Next
      scriptTag.type = 'text/javascript';
      scriptTag.setAttribute('nonce','22os9h3sdfa');
      scriptTag.src = url;
  
      scriptTag.onload = implementationCode;//Will It be work? -&gt; scriptTag.onload = scriptTag_Next = implementationCode;
      scriptTag.onreadystatechange = implementationCode;//like as above scriptTag_Next.onreadystatechange ??
  
      document.body.appendChild(scriptTag);
  };
  var yourCodeToBeCalled = function(){
      console.log('okay'); } loadJS('js/jquery-3_1_1.min.js', yourCodeToBeCalled);//My my suggestion loadJS('js/jquery-3_1_1.min.js', 'js/test.js' yourCodeToBeCalled)
  </code></pre>
  
  <p>Original code I borrowed from: <a href="https://stackoverflow.com/a/31374433/6256645">link</a></p>