2 Replies Latest reply on May 16, 2017 8:30 AM by f.i.sciences

    WebDirect with THREE.JS : SecurityError (DOM Exception 18): The operation is insecure.

    f.i.sciences

      I'm doing a THREE.JS development under a WebView. All is working fine under FMP, connected to FMS.

      But if I open it under WebDirect, I get this error: 'SecurityError (DOM Exception 18): The operation is insecure.'

      It has something to do with the texture who is not loading.

       

      I had another error about CORS before that one (XMLHttpRequest cannot load is not allowed by Access-Control-Allow-Origin).

      I resolved it by enabling CORS on IIS for the FMS server. Now the CORS error is gone. But stuck with the DOM exception 18.

      I'm using default port for FMS and loading JPG texture, JavaScript from the same server/location (C:\Program Files\FileMaker\FileMaker Server\HTTPServer\conf).

       

      Here the path used for:

      Load WebDirect: http://remote.plancher2000.com/fmi/webd#Développement

      Loading JS code: <script type='text/javascript' src='http://remote.plancher2000.com/three.js-master/build/three.js'></script>

      Loading JPG texture:  THREE.TextureLoader().load('http://remote.plancher2000.com/Escaliers 3D/1-3-2-5-Bois.jpg')

       

      It should be working, because if I load this Three.js Web page sample in a Web Viewer in WebDirect, it works.

       

           https://threejs.org/examples/?q=tex#webgl_materials_texture_anisotropy

       

      The image used there load from the same path/server (relative location, see below).

           var texture1 = textureLoader.load( "textures/crate.gif" );

       

      Removing the first part 'http://remote.plancher2000.com/' to leave only 'Escaliers 3D/1-3-2-5-Bois.jpg' prevent texture from loading and gave error 'XMLHttpRequest cannot load Escaliers 3D/1-3-2-5-Bois.jpg. Cross origin requests are only supported for HTTP.' and 'DOM 19' (related to previous error) on WebDirect.

       

      How can I find out it's related to what, and resolve it?

      This problem is on Safari, Chrome and IE. From Mac to PC.

       

      Thank you.