Html script doesn't work anymore after moving into source file - why so? how to fix? : <p>I got an html file that looks somewhat like this:
</p>

<pre class="lang-html prettyprint-override"><code>&lt;html&gt;
&lt;head&gt;
  &lt;script type="text/javascript" src="lang-parser.js"&gt;&lt;/script&gt;
  &lt;script id="code" type="text/some-scripting-language"&gt;
  //some code here in some language that is not js
  &lt;/script&gt;
  &lt;script type="text/javascript" src="sketch.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div id="canvas"&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Everything works and seems fine. Now I take the code in the middle script and move  it into another file, and change the html code for that to:</p>

<pre class="lang-html prettyprint-override"><code>  &lt;script id="code" src="code.cdy" type="text/some-scripting-language"&gt;&lt;/script&gt;
</code></pre>

<p>and it stops working, without any explicit errors, as if the script didn't load in time or something.</p>

<p>My question is: what can be the reason for this behavior and how can I change it?</p>

<p>Notes:</p>

<ol>
<li>Even if I write a wrong name of the file the console doesn't inform me about non-existent file. </li>
<li>If I additionally write that the file is of type <code>text/javascript</code> (which it is not), when the console finally informs me the file doesn't exist.</li>
<li>IMHO: It looks like the language parser gets downloaded asynchronously, and while it is in the process the parser reads the next tag, sees unknown type of language there and just ignores the entire thing... But that doesn't explain why without the source the code works. </li>
</ol>
