I have seen the following question where someone asked how to remove shaders from html:
WebGL - is there an alternative to embedding shaders in HTML?
There are elaborate workarounds to load in a file containing the shader suggested in the answers to the question.
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?
<script type=x-shader/x-fragment id=shader-fs src=util/fs></script>
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.