I want to load the fragment shader from an external file, but it dont works. (after the shader is loaded, the alertbox don't appear.)
var fs = document.createElement('script');
fs.setAttribute("type","x-shader/x-fragment");
fs.setAttribute("src", "shader.fs");
fs.onload = function() {alert('done');}
document.getElementsByTagName("head")[0].appendChild(fs);
<script>elements.