Question

I want to load the x3dom js library using requirejs. It's not working and produce the following error: TypeError: x3dom.gfx_webgl is not a function

I load the x3dom library like that:

require(['jquery-ui', 'x3dom'], function($, x3dom){ 
   console.log(x3dom);
   $('#test').html("hello");
});

You can see here that the loading of the libs seems to work (it's working for jquery).

I have a jsfiddle that shows the problem: http://jsfiddle.net/ayGR5/2/

If you load the script in the html pane (uncomment <!--<script src="http://www.x3dom.org/download/x3dom.js"></script>--> and comment lines 20-22 in the js pane), it's working.

Was it helpful?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top