<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    <p>I have also discovered that if I put a breakpoint in the debugger
      in JSONParser.java, below, my scene works much better.  I will try
      to get some examples out soon.<br>
    </p>
    <p><br>
    </p>
    <p>JSONParser .prototype.<br>
              parseJavaScript = function(jsobj, success, error) {<br>
                  var child = this.CreateElement('X3D');  //
      <<<<< breakpoint here.<br>
                  this.ConvertToX3DOM(jsobj, "", child);<br>
                  // call the DOM parser<br>
                  this.parseIntoScene(child, success, error);<br>
                  return child;<br>
              };<br>
    </p>
    <div class="moz-cite-prefix">On 6/15/21 6:40 AM, Holger Seelig
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:77D5F4EA-77E7-4411-8DAA-4013D8D3DEB9@yahoo.de">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      Hello John,
      <div class=""><br class="">
      </div>
      <div class="">There was indeed a bug in X_ITE, in importJS, that
        the .dom property of the resulting scene was not set. This is
        fixed now. I also updated the documentation that there is also
        an async version of .importJS. The async version must be used if
        you specify profile or components that are not in the main
        packaged of X_ITE, like the Layout component, which is loaded
        later, only if needed. But you can also use the sync version if
        you only need VRML.</div>
      <div class=""><br class="">
      </div>
      <div class="">See:</div>
      <div class=""><a
href="https://github.com/create3000/x_ite/wiki/Browser-Services#x3dscene-importdocument-domobject-dom"
          class="" moz-do-not-send="true">https://github.com/create3000/x_ite/wiki/Browser-Services#x3dscene-importdocument-domobject-dom</a></div>
      <div class=""><br class="">
      </div>
      <div class="">Here is a full example:</div>
      <div class=""><br class="">
      </div>
      <div class="">
        <div style="color: rgb(54, 54, 54); background-color: rgb(255, 255, 255); font-family: Menlo, Monaco, "Courier New", monospace; line-height: 18px; white-space: pre;" class=""><div class=""><span style="color: rgb(159, 159, 159);" class=""><</span><span style="color: rgb(63, 151, 223);" class="">html</span><span style="color: rgb(159, 159, 159);" class="">></span></div><div class="">  <span style="color: rgb(159, 159, 159);" class=""><</span><span style="color: rgb(63, 151, 223);" class="">head</span><span style="color: rgb(159, 159, 159);" class="">></span></div><div class="">    <span style="color: rgb(159, 159, 159);" class=""><</span><span style="color: rgb(63, 151, 223);" class="">meta</span> <span style="color: rgb(9, 89, 132);" class="">charset</span>=<span style="color: rgb(162, 86, 55);" class="">"utf-8"</span><span style="color: rgb(159, 159, 159);" class="">/></span></div><div class="">    <span style="color: rgb(159, 159, 159);" class=""><</span><span style="color: rgb(63, 151, 223);" class="">link</span> <span style="color: rgb(9, 89, 132);" class="">rel</span>=<span style="color: rgb(162, 86, 55);" class="">"stylesheet"</span> <span style="color: rgb(9, 89, 132);" class="">type</span>=<span style="color: rgb(162, 86, 55);" class="">"text/css"</span> <span style="color: rgb(9, 89, 132);" class="">href</span>=<span style="color: rgb(162, 86, 55);" class="">"<a href="https://create3000.github.io/code/x_ite/latest/dist/x_ite.css" class="" moz-do-not-send="true">https://create3000.github.io/code/x_ite/latest/dist/x_ite.css</a>"</span><span style="color: rgb(159, 159, 159);" class="">/></span></div><div class="">    <span style="color: rgb(159, 159, 159);" class=""><</span><span style="color: rgb(63, 151, 223);" class="">script</span> <span style="color: rgb(9, 89, 132);" class="">type</span>=<span style="color: rgb(162, 86, 55);" class="">"text/javascript"</span> <span style="color: rgb(9, 89, 132);" class="">src</span>=<span style="color: rgb(162, 86, 55);" class="">"<a href="https://create3000.github.io/code/x_ite/latest/dist/x_ite.min.js" class="" moz-do-not-send="true">https://create3000.github.io/code/x_ite/latest/dist/x_ite.min.js</a>"</span><span style="color: rgb(159, 159, 159);" class="">></</span><span style="color: rgb(63, 151, 223);" class="">script</span><span style="color: rgb(159, 159, 159);" class="">></span></div><div class="">    <span style="color: rgb(159, 159, 159);" class=""><</span><span style="color: rgb(63, 151, 223);" class="">style</span> <span style="color: rgb(9, 89, 132);" class="">type</span>=<span style="color: rgb(162, 86, 55);" class="">"text/css"</span><span style="color: rgb(159, 159, 159);" class="">></span></div><div class="">X3DCanvas {</div><div class="">  <span style="color: rgb(9, 89, 132);" class="">width</span>: <span style="color: rgb(73, 104, 57);" class="">768px</span>;</div><div class="">  <span style="color: rgb(9, 89, 132);" class="">height</span>: <span style="color: rgb(73, 104, 57);" class="">432px</span>;</div><div class="">}</div><div class="">    <span style="color: rgb(159, 159, 159);" class=""></</span><span style="color: rgb(63, 151, 223);" class="">style</span><span style="color: rgb(159, 159, 159);" class="">></span></div><div class="">    <span style="color: rgb(159, 159, 159);" class=""><</span><span style="color: rgb(63, 151, 223);" class="">script</span> <span style="color: rgb(9, 89, 132);" class="">src</span>=<span style="color: rgb(162, 86, 55);" class="">"<a href="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js" class="" moz-do-not-send="true">https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js</a>"</span><span style="color: rgb(159, 159, 159);" class="">></</span><span style="color: rgb(63, 151, 223);" class="">script</span><span style="color: rgb(159, 159, 159);" class="">></span></div><div class="">    <span style="color: rgb(159, 159, 159);" class=""><</span><span style="color: rgb(63, 151, 223);" class="">script</span><span style="color: rgb(159, 159, 159);" class="">></span></div><div class=""><span style="color: rgb(63, 151, 223);" class="">function</span> <span style="color: rgb(99, 99, 36);" class="">load</span> ()</div><div class="">{</div><div class="">  <span style="color: rgb(9, 89, 132);" class="">console</span> .<span style="color: rgb(99, 99, 36);" class="">log</span> (<span style="color: rgb(162, 86, 55);" class="">"load"</span>);</div>
<div class="">  <span style="color: rgb(15, 157, 235);" class="">$</span>.<span style="color: rgb(99, 99, 36);" class="">getJSON</span> (<span style="color: rgb(162, 86, 55);" class="">"Billboard.x3dj"</span>, <span style="color: rgb(63, 151, 223);" class="">function</span> (<span style="color: rgb(9, 89, 132);" class="">json</span>)</div><div class="">  {</div><div class="">    <span style="color: rgb(99, 99, 36);" class="">X3D</span> (<span style="color: rgb(63, 151, 223);" class="">function</span> ()</div><div class="">    {</div><div class="">      <span style="color: rgb(63, 151, 223);" class="">var</span> <span style="color: rgb(9, 89, 132);" class="">Browser</span> = <span style="color: rgb(15, 157, 235);" class="">X3D</span> .<span style="color: rgb(99, 99, 36);" class="">getBrowser</span> ();</div>
<div class="">      <span style="color: rgb(9, 89, 132);" class="">Browser</span> .<span style="color: rgb(99, 99, 36);" class="">importJS</span> (<span style="color: rgb(9, 89, 132);" class="">json</span>, <span style="color: rgb(63, 151, 223);" class="">function</span> (<span style="color: rgb(9, 89, 132);" class="">scene</span>)</div><div class="">      {</div><div class="">        <span style="color: rgb(9, 89, 132);" class="">Browser</span> .<span style="color: rgb(99, 99, 36);" class="">replaceWorld</span> (<span style="color: rgb(9, 89, 132);" class="">scene</span>);</div><div class="">        <span style="color: rgb(9, 89, 132);" class="">console</span> .<span style="color: rgb(99, 99, 36);" class="">log</span> (<span style="color: rgb(9, 89, 132);" class="">scene</span> .<span style="color: rgb(9, 89, 132);" class="">dom</span>);</div><div class="">      });</div><div class="">    });</div><div class="">  });</div><div class="">}</div><div class="">    <span style="color: rgb(159, 159, 159);" class=""></</span><span style="color: rgb(63, 151, 223);" class="">script</span><span style="color: rgb(159, 159, 159);" class="">></span></div><div class="">  <span style="color: rgb(159, 159, 159);" class=""></</span><span style="color: rgb(63, 151, 223);" class="">head</span><span style="color: rgb(159, 159, 159);" class="">></span></div><div class="">  <span style="color: rgb(159, 159, 159);" class=""><</span><span style="color: rgb(63, 151, 223);" class="">body</span><span style="color: rgb(159, 159, 159);" class="">></span></div><div class="">    <span style="color: rgb(159, 159, 159);" class=""><</span><span style="color: rgb(63, 151, 223);" class="">X3DCanvas</span><span style="color: rgb(159, 159, 159);" class="">></</span><span style="color: rgb(63, 151, 223);" class="">X3DCanvas</span><span style="color: rgb(159, 159, 159);" class="">></span></div><div class="">    <span style="color: rgb(159, 159, 159);" class=""><</span><span style="color: rgb(63, 151, 223);" class="">button</span> <span style="color: rgb(9, 89, 132);" class="">onclick</span>=<span style="color: rgb(162, 86, 55);" class="">"</span><span style="color: rgb(99, 99, 36);" class="">load</span><span style="color: rgb(162, 86, 55);" class="">()</span><span style="color: rgb(162, 86, 55);" class="">"</span><span style="color: rgb(159, 159, 159);" class="">></span>Click Me!<span style="color: rgb(159, 159, 159);" class=""></</span><span style="color: rgb(63, 151, 223);" class="">button</span><span style="color: rgb(159, 159, 159);" class="">></span></div><div class="">  <span style="color: rgb(159, 159, 159);" class=""></</span><span style="color: rgb(63, 151, 223);" class="">body</span><span style="color: rgb(159, 159, 159);" class="">></span></div><div class=""><span style="color: rgb(159, 159, 159);" class=""></</span><span style="color: rgb(63, 151, 223);" class="">html</span><span style="color: rgb(159, 159, 159);" class="">></span></div>
</div>
      </div>
      <div class=""><br class="">
        <div><br class="">
          <blockquote type="cite" class="">
            <div class="">Am 15.06.2021 um 03:19 schrieb John Carlson
              <<a href="mailto:yottzumm@gmail.com" class=""
                moz-do-not-send="true">yottzumm@gmail.com</a>>:</div>
            <br class="Apple-interchange-newline">
            <div class="">
              <meta http-equiv="Content-Type" content="text/html;
                charset=windows-1252" class="">
              <div class="">
                <p class=""> Holger,</p>
                <p class=""><br class="">
                </p>
                <p class="">My main code currently looks like the
                  below.  I believe I patched the problem with ajv
                  internationalization in loaderJQuery.js<br class="">
                </p>
                <p class="">Umm, to me, it looks like your shader
                  programs aren't working--the "Program" in the console
                  log, even though they downloaded successfully?  I'm
                  not sure if the shaders are related to your initial
                  graphics, or something else.  Initial graphics seem to
                  be working.  Perhaps there's an issue with the url
                  file/path?<br class="">
                </p>
                <p class="">    <script type="text/javascript"><br
                    class="">
                              <br class="">
                          var url = "../data/ArchHalf.json";<br class="">
                          var selector = "#x_itedom";<br class="">
                      <br class="">
                          function importInto_X_ITE(json) {<br class="">
                                  loadX3DJS_X_ITE(selector,
                  document.implementation, json, url, "", loadSchema,
                  doValidate, X3DJSONLD, function(jsDOM) {<br class="">
                                          load_X_ITE_DOM(jsDOM,
                  selector);<br class="">
                                  });<br class="">
                          }<br class="">
                          $(document).ready(function() {<br class="">
                                  $.getJSON(url, importInto_X_ITE);<br
                    class="">
                          });<br class="">
                  <br class="">
                      </script></p>
                <p class="">====================================================================================================</p>
                <p class="">The error seems to be in this showing up in
                  this code in X3DJSONLD.  It looks like child.dom is
                  undefined on the return from browser.importJS.  I'm
                  guessing there was some change to X_ITE or x_ite_dom? 
                  <br class="">
                </p>
                <p class="">I tried including x_ite_dom 1.3. child.dom
                  is still the same. So it looks like I broke
                  encapsulation.  Hmm.  This will take some
                  investigation.  It may be that the return value from
                  JSONParser.parseJavaScript() is undefined!  Hmm. 
                  Well, back to debugger.<br class="">
                </p>
                <p class="">function loadX3DJS_X_ITE(selector,
                  DOMImplementation, jsobj, path, NS, loadSchema,
                  doValidate, X3DJSONLD, callback) {<br class="">
                      X3DJSONLD.x3djsonNS = NS;<br class="">
                      loadSchema(jsobj, path, doValidate, X3DJSONLD,
                  function() {<br class="">
                          X3D(function() {<br class="">
                              if (typeof X3D.getBrowser !== 'undefined')
                  {<br class="">
                                  var browser =
                  X3D.getBrowser(selector);<br class="">
                                  if (typeof browser !== 'undefined'
                  && typeof browser.importJS !== 'undefined') {<br
                    class="">
                                      var child =
                  browser.importJS(jsobj);<br class="">
                                      var xml =
                  X3DJSONLD.serializeDOM(jsobj, child.dom, true);<br
                    class="">
                                      callback(child.dom, xml);<br
                    class="">
                                  }<br class="">
                              }<br class="">
                          }, function() {<br class="">
                              alert("Failed to render JSON to X_ITE");<br
                    class="">
                          });<br class="">
                      }, function(e) {<br class="">
                          console.error(e);<br class="">
                          callback(null, null);<br class="">
                      });<br class="">
                  }<br class="">
                  <br class="">
                </p>
                <div class="moz-cite-prefix">On 6/4/21 7:34 AM, John
                  Carlson wrote:<br class="">
                </div>
                <blockquote type="cite"
cite="mid:CAGC3UEnWbdXwUOV0gX_eUysc9Grv4oJ=HkUKs+qe5bmXFXD06A@mail.gmail.com"
                  class="">
                  <meta http-equiv="content-type" content="text/html;
                    charset=windows-1252" class="">
                  <div dir="auto" class="">My load functions,
                    particularly load_X_ITE_DOM should call the X3D
                    function.         </div>
                  <div dir="auto" class=""><br class="">
                  </div>
                  <div dir="auto" class="">The error in index.js is in
                    the JSON validation suite, and hopefully not
                    escaping the try/catch.    I was noticing that the
                    element was undefined, and that may be the result of
                    something not valid.  Clicking ok on the validation
                    error pop up should take one past validation.  One
                    should try to find a valid JSON file to load with
                    APjsonImport.xhtml .   I am going to sleep now and
                    will try to pursue this tonight.</div>
                  <div class=""><br class="">
                    <div class="gmail_quote">
                      <div dir="ltr" class="gmail_attr">On Fri, Jun 4,
                        2021 at 6:26 AM Holger Seelig <<a
                          href="mailto:holger.seelig@yahoo.de"
                          moz-do-not-send="true" class="">holger.seelig@yahoo.de</a>>
                        wrote:<br class="">
                      </div>
                      <blockquote class="gmail_quote" style="margin:0px
                        0px 0px
0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">
                        <div
                          style="word-wrap:break-word;line-break:after-white-space"
                          class="">
                          <div class="">The most common mistake is that
                            the X3D Browser is not available from the
                            beginning of the HTML page. Thus a call to
                            the X3D function to access the Browser must
                            be wrapped, see:</div>
                          <div class=""><br class="">
                          </div>
                          <a
href="https://github.com/create3000/x_ite/wiki/Accessing-the-External-Browser"
                            target="_blank" moz-do-not-send="true"
                            class="">https://github.com/create3000/x_ite/wiki/Accessing-the-External-Browser</a>
                          <div class=""><br class="">
                          </div>
                          <div class="">But there are is also this error
                            in the console </div>
                          <div class=""><br class="">
                          </div>
                          <div class="">[Error] Failed to load resource:
                            the server responded with a status of 404 ()
                            (index.js, line 0)</div>
                          <div class=""><a
href="https://coderextreme.net/X3DJSONLD/src/main/node/ajv-i18n/localize/de-de/index.js"
                              target="_blank" moz-do-not-send="true"
                              class="">https://coderextreme.net/X3DJSONLD/src/main/node/ajv-i18n/localize/de-de/index.js</a></div>
                        </div>
                        <div
                          style="word-wrap:break-word;line-break:after-white-space"
                          class="">
                          <div class=""><br class="">
                          </div>
                          <div class="">Holger</div>
                          <div class=""><br class="">
                            <div class=""><br class="">
                              <blockquote type="cite" class="">
                                <div class="">Am 04.06.2021 um 12:43
                                  schrieb John Carlson <<a
                                    href="mailto:yottzumm@gmail.com"
                                    target="_blank"
                                    moz-do-not-send="true" class="">yottzumm@gmail.com</a>>:</div>
                                <br class="">
                                <div class="">
                                  <div class="">I'm trying to get these
                                    working:<br class="">
                                    <br class="">
                                    <a
href="https://coderextreme.net/X3DJSONLD/src/main/html/AP_minimal_JSLD.html"
                                      target="_blank"
                                      moz-do-not-send="true" class="">https://coderextreme.net/X3DJSONLD/src/main/html/AP_minimal_JSLD.html</a><br
                                      class="">
                                    <br class="">
                                    <a
href="https://coderextreme.net/X3DJSONLD/src/main/html/AP_minimal_JSLD.xhtml"
                                      target="_blank"
                                      moz-do-not-send="true" class="">https://coderextreme.net/X3DJSONLD/src/main/html/AP_minimal_JSLD.xhtml</a><br
                                      class="">
                                    <br class="">
                                    This may provide some guidance:<br
                                      class="">
                                    <br class="">
                                    <a
href="https://coderextreme.net/X3DJSONLD/src/main/html/APjsonImport.xhtml"
                                      target="_blank"
                                      moz-do-not-send="true" class="">https://coderextreme.net/X3DJSONLD/src/main/html/APjsonImport.xhtml</a>
                                    or at least somewhat easy selection
                                    of files, and both X3DOM (works) and
                                    X_ITE (fails). (Feel free to reduce
                                    number of files in <select>)<br
                                      class="">
                                    <br class="">
                                    I realize I could probably use older
                                    versions of X_ITE, but I'm more
                                    interested in possible current
                                    features I'm missing.<br class="">
                                    <br class="">
                                    I am not having issues with Inline
                                    with *.json files, as far as I can
                                    tell, mostly just index.html<br
                                      class="">
                                    <br class="">
                                    Repository is below, master branch.<br
                                      class="">
                                    <br class="">
                                    <a
                                      href="https://github.com/coderextreme/X3DJSONLD/"
                                      target="_blank"
                                      moz-do-not-send="true" class="">https://github.com/coderextreme/X3DJSONLD/</a><br
                                      class="">
                                    <br class="">
                                    Thanks for any basic assistance you
                                    have.<br class="">
                                    <br class="">
                                    It's highly likely I may have
                                    problems with the JSON schema.<br
                                      class="">
                                    <br class="">
                                    I will now look at X_ITE
                                    documentation.<br class="">
                                    <br class="">
                                    John<br class="">
                                    <br class="">
                                  </div>
                                </div>
                              </blockquote>
                            </div>
                            <br class="">
                          </div>
                        </div>
                      </blockquote>
                    </div>
                  </div>
                </blockquote>
              </div>
            </div>
          </blockquote>
        </div>
        <br class="">
      </div>
    </blockquote>
  </body>
</html>