title: Global variable does'nt work after external .js file in script tag
body: <p>Here my javascript code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var js = document.createElement("script");
  js.type = "text/javascript";
  js.src = "//mysite.co/js.js";
  document.body.appendChild(js);
  
  alert(x);
  
  &lt;/script&gt;
  </code></pre>
  
  <p>In mysitecom/js.js file is like that</p>
  
  <pre><code>var x = '1233123';
  //some code
  </code></pre>
  
  <p>The problem is the alert doesn't work. In google chrome's console says</p>
  
  <blockquote>
    <p>Uncaught ReferenceError: x is not defined mypage:31
    (anonymous function)</p>
  </blockquote>
  
  <p>But if i include external js file like that;</p>
  
  <pre><code>&lt;script src="//mysite.co/js.js" type="text/javascript" &gt;&lt;/script&gt;
  </code></pre>
  
  <p>It works.</p>
  
  <p>But i need the first method...</p>
  
  <p>What is the fix?</p>
  
  <p>Thanks.</p>