<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Holger, can you provide insight as to why the this code logs that Cobweb disabled first time through? I have been ignoring this, but I think it’s time to address it. Does the page need to be loaded before this is called? Thanks!<div class=""><br class=""></div><div class="">John<br class=""><div class=""><br class=""><div class="">// HTML5 with iframe reference to cobwebframe.html</div><div class=""><span style="font-family: Menlo; font-size: 11px;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span><iframe</span><span style="font-family: Menlo; font-size: 11px;" class=""> </span><span style="font-family: Menlo; font-size: 11px;" class="">id='cobwebframe' src="cobwebframe.html"></iframe></span></div><div class=""><br class=""></div><div class=""><!— snip —></div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>var content = $('textarea#xml').val();</div><div class=""><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>var cobwebWindow = document.getElementById("cobwebframe").contentWindow ;</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>var cobwebEle = cobwebWindow.document.getElementById("x3dele");</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>if (typeof cobwebWindow.X3D !== 'undefined') {</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>var browser = cobwebWindow.X3D.getBrowser(cobwebEle);</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>browser.replaceWorld(browser.createX3DFromString(content));</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>} else {</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>console.error("Cobweb disabled. Use Firefox.");</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>}</div></div><div class=""><br class=""></div><div class="">———— cobwebframe.html ————</div><div class=""><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><!DOCTYPE html></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><html></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <head></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <title>Cobweb Iframe loader</title></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <link rel="stylesheet" type="text/css" href="<a href="https://cdn.rawgit.com/create3000/cobweb/master/stable/1/1.21/cobweb.css" class="">https://cdn.rawgit.com/create3000/cobweb/master/stable/1/1.21/cobweb.css</a>"/></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <script type="text/javascript" src="<a href="https://cdn.rawgit.com/create3000/cobweb/master/stable/1/1.21/cobweb.min.js" class="">https://cdn.rawgit.com/create3000/cobweb/master/stable/1/1.21/cobweb.min.js</a>"></script></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <style></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">X3D {</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> width: 192px;</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> height:108px;</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">body {</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> margin:0px;</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> padding:0px;</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> </style></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> </head></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <body></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <X3D id='x3dele' cache='false' url='"ArchPrototype.x3d"'></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <p>Your browser may not support all features required by Cobweb!</p></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> </X3D></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> </body></p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""></html></p></div><div class=""><div><blockquote type="cite" class=""><div class="">On Jan 9, 2016, at 1:37 AM, John Carlson <<a href="mailto:yottzumm@gmail.com" class="">yottzumm@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><pre class=""> Thanks to Andreas Plesch. Holger, could you add something like this to the Cobweb page to document how to build xml on the fly and submit it to Cobweb for viewing? Thanks, John</pre><pre class="">For an frame outside an iframe, xml being an array of strings.</pre><pre class=""> var content = xml.join("");</pre><pre class=""> var cobwebWindow = document.getElementById("cobwebframe").contentWindow ;
var cobwebEle = cobwebWindow.document.getElementById("x3dele");
if (typeof cobwebWindow.X3D !== 'undefined') {
var browser = cobwebWindow.X3D.getBrowser(cobwebEle);
browser.replaceWorld(browser.createX3DFromString(content));
// etc.
}
</pre><pre class=""><br class=""></pre><pre class="">and something else for loading inside the same document (which I can get from Andreas, I think).</pre><pre class=""><br class=""></pre><pre class="">John</pre><div class=""><br class="webkit-block-placeholder"></div></div></div></blockquote></div><br class=""></div></div></div></body></html>