title: onLoad in TextureLoader is not working?
body: <p>Am using texture loader in Three.js, the <code>onLoad</code> function in it is not working gives an error in the console</p>
  
  <pre><code>var TextureLoader = new THREE.TextureLoader();
  
  boxtexture.onChange(function (value) {
  
      TextureLoader.load('textures/' + value,
  
          // onLoad callback
          function(texture){
              Box1.material.map = texture
              Box1.material.map.wrapT = THREE.RepeatWrapping;
              Box1.material.map.wrapS = THREE.RepeatWrapping;
              Box1.material.map.repeat.set(38, 38);
              Box2.material.map = texture
              Box2.material.map.wrapT = THREE.RepeatWrapping;
              Box2.material.map.wrapS = THREE.RepeatWrapping;
              Box2.material.map.repeat.set(38, 38);
          },
  
          // onProgress callback
          function(loaded)
          {
              load = 1;
              console.log(loaded);
              window.open(Renderer.domElement.toDataURL());
          }
      );
  
  });
  </code></pre>
  
  <p>But it doesn't call the <code>onLoad</code> function and gives an error message in console
  The textures are loaded properly. But I need to call a function when it is loaded.</p>
  
  <p><a href="https://i.stack.imgur.com/GP7jZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GP7jZ.png" alt="the methods for textureLoader in three.js"></a></p>
  
  <p><a href="https://i.stack.imgur.com/upCaU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/upCaU.png" alt="console error"></a></p>