title: Webgl's getAttribLocation oddly returns -1
body: <p>I have managed to isolate the problem in this code:</p>
  
  <pre><code>var gl;
  _main_web = function() {
      gl = document.getElementById("canvas").getContext("experimental-webgl");
  
      gl = WebGLDebugUtils.makeDebugContext(gl,
      function (err, funcName, args) {
          throw(WebGLDebugUtils.glEnumToString(err) + " was caused by call to " + funcName);
      }
      );
  
      vert_shader = gl.createShader(gl.VERTEX_SHADER);
      gl.shaderSource(vert_shader,"attribute vec4 vertex;attribute vec2 uv; void main(void) {gl_Position = vertex;}\n");
      gl.compileShader(vert_shader);
      if( !gl.getShaderParameter(vert_shader,gl.COMPILE_STATUS ) ) {
          throw 0;
      }
      frag_shader = gl.createShader(gl.FRAGMENT_SHADER);
      gl.shaderSource(frag_shader,"void main(void) { gl_FragColor = vec4(1.0,1.0,1.0,1.0); } \n");
      gl.compileShader(frag_shader);
      if( !gl.getShaderParameter(frag_shader,gl.COMPILE_STATUS) ) {
          throw 1;
      }
      program = gl.createProgram();
      gl.attachShader(program,vert_shader);
      gl.attachShader(program,frag_shader);
      gl.linkProgram(program);
      if( !gl.getProgramParameter(program,gl.LINK_STATUS) ) {
          throw 2;
      }
  
      vertexLocation = gl.getAttribLocation(program,"vertex");
      textureLocation = gl.getAttribLocation(program,"uv");
  }
  </code></pre>
  
  <p>vertexLocation is alright, it is 0. But textureLocation is -1, what am I missing?</p>