[x3d-public] dual use of script tag in HTML environment
Andreas Plesch
andreasplesch at gmail.com
Wed Sep 21 20:30:50 PDT 2016
https://andreasplesch.github.io/cobweb_dom/tests/x3d_script.xhtml
Since the script tag is already claimed by HTML, there is a conflict with
the XML encoding of the x3d script node when x3d nodes are considered page
DOM elements.
Nevertheless, in the page above, both types of JavaScripts, 'regular' web
page and 'special' x3d, function correctly. The sphere is controlled by a
SAI script whereas all other actions are driven by HTML scripts.
This is possible because a HTML script element with a type attribute which
is not recognized as an ecmascript related mime type is not executed by the
web browser. In the example I used application/x-vrmlscript which at some
point was the recommended mime type. But application/SAIscript would also
have the desired effect, for example.
Cobweb, on the other hand, is not bothered by the type attribute and
proceeds to execute the script as a x3d script.
This solution to allow dual use of the script tag would be understood by
web developers because the script tag with special type attributes is used
fairly widely to protect data content from being interpreted by the browser
in some way.
While this is practical today, what would be required in the standard to
allow such a type attribute in the XML encoding of the x3d script node?
Since this type attribute would not represent a field, perhaps only the XML
encoding standard would be affected?
Andreas
--
Andreas Plesch
39 Barbara Rd.
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160921/6bc273da/attachment.html>
More information about the x3d-public
mailing list