[x3d-public] Duplicate x3d scenes shown in HTML.

John Carlson yottzumm at gmail.com
Thu Jun 15 07:08:16 PDT 2017

Leonard, I am currently generating JavaScript once for both instances.
Thus I need to have an array or object which points to each JavaScript
instance in JavaScript for proxy events, not a single global object.   It's
not only HTML.

On Jun 15, 2017 9:34 AM, "Leonard Daly" <Leonard.Daly at realism.com> wrote:

I know there is a followup email to this, but this one perhaps may be the
easiest to answer...

If the exact same scene is displayed in two separate X3D "windows" on an
HTML page, it comes down to how the X3D is handled.

If X3D is handled via pluggin, then as long as the plugin keeps the
instances separate; there should not be an issue. I believe BS Contact
works this way.

If the code is directly inline and displayed via a JavaScript-based engine
(e.g., X3DOM and perhaps Cobweb), then it depends on the X3D code. If there
is no use of the 'id' attribute then things should be handled separately. I
know that X3DOM keeps an array of instances at the very top level. If the
X3D code uses 'id', then the resultant HTML file is not valid as there are
two occurrences of the same 'id'. But, this being HTML, the browser will
not crash; but references to 'id' will not work separately.

In HTML there is only one namespace and namescope. All user-supplied HTML
script code will need to correctly manage that there are two instances. It
may be sufficient to use $('#x3d_instance_1
and $('#x3d_instance_2 transform).not('some-selection-criteria') to
differentiate between the two instances when accessing X3D nodes from
JavaScript code.

Leonard Daly

What happens if duplicate x3d scenes are shown in HTML.   Are the
JavaScript variables shared, or are they made unique?



x3d-public mailing
listx3d-public at web3d.orghttp://web3d.org/mailman/listinfo/x3d-public_web3d.org

*Leonard Daly*
3D Systems & Cloud Consultant
President, Daly Realism - *Creating the Future*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170615/e619a5b4/attachment.html>

More information about the x3d-public mailing list