title: Javascript and WebGL, external scripts
body: <p>Just curious; How do I place my webgl shaders, in an external file?</p>
  
  <p>Currently I'm having;</p>
  
  <pre><code>    &lt;script id="shader-fs" type="x-shader/x-fragment"&gt;
          #ifdef GL_ES
              precision highp float;
          #endif
  
          void main(void)
          {
              gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
          }
      &lt;/script&gt;
  
      &lt;script id="shader-vs" type="x-shader/x-vertex"&gt;
          attribute vec3 aVertexPosition;
  
          uniform mat4 uMVMatrix;
          uniform mat4 uPMatrix;
  
          void main(void)
          {
              gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);
          }
      &lt;/script&gt;
  </code></pre>
  
  <p>In my html header, how do I link in this from an external file? - I tried the usual javascript approach;</p>
  
  <pre><code>&lt;script type="text/javascript" src="webgl_shader.js"&gt;&lt;/script&gt;
  </code></pre>