https://jsfiddle.net/mkba0ecu/
I am testing out the cube example.
I have an existing web page with lots of stuff on it. I added a button so that server returns the javascript defined in the tag of the cube fiddle example. However it throws an error. Am I not able to dynamically run the code? I do have three.js included (the latest)
Uncaught TypeError: JSON.stringify is not a function
at ShaderMaterial.copy (three.js:9002)
at ShaderMaterial.copy (three.js:13351)
at ShaderMaterial.clone (three.js:8928)
at new WebGLShadowMap (three.js:19875)
at new WebGLRenderer (three.js:23614)
at eval (eval at executeJS (mystuff.js:61), :5:19)
at executeJS (mystuff.js:61)
at XMLHttpRequest.page_request.onreadystatechange (choice.js:41)