title: Why do shaders have to be in html file for webgl program?
body: <p>I have seen the following question where someone asked how to remove shaders from html:
  <a href="https://stackoverflow.com/questions/5878703/webgl-is-there-an-alternative-to-embedding-shaders-in-html">WebGL - is there an alternative to embedding shaders in HTML?</a></p>
  
  <p>There are elaborate workarounds to load in a file containing the shader suggested in the answers to the question.</p>
  
  <p>In the tutorial I saw, the shader code is embedded directly in the html.
  The javascript code refers to it using getElementById.  But it's ugly embedding the shader directly in the html for many reasons.  Why can't I just refer to it externally using the src= attribute?</p>
  
  <pre><code>&lt;script type="x-shader/x-fragment" id="shader-fs" src="util/fs"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>The above doesn't work, I just want to know why not.  This is clearly something to do with limitations on script itself, but I don't get it.</p>