[x3d-public] dual use of script tag in HTML environment

Andreas Plesch andreasplesch at gmail.com
Thu Sep 22 12:21:32 PDT 2016

Here some relevant resources with regards to the script element and its
dual use:

HTML5 spec. of script element:


HTML5 spec. of the mime types which must be recognized and executed by web


The same section also specifies a few mime types which must not be executed
by the browser. For example, 'application/xml' will never be interpreted
and executed by a browser.


1996 SGI vrmlscript MIME type recommendation.

On Wed, Sep 21, 2016 at 11:30 PM, Andreas Plesch <andreasplesch at gmail.com>

> 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

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/20160922/75d37eb4/attachment.html>

More information about the x3d-public mailing list