[X3D-Public] [x3dom-developers] Fwd: [X3D] Comment: need ability to import separate Javascript source library into embedded X3D Script code

doug sanden highaspirations at hotmail.com
Sun Dec 7 09:13:07 PST 2014


How about making script.url an MFMFString [[][]]? Each MFString would be for one .js to load into the Script node, in the order given.
-Doug

________________________________
> Date: Sun, 7 Dec 2014 09:02:18 -0800 
> From: web3d at realism.com 
> To: yottzumm at gmail.com; brutzman at nps.edu 
> CC: x3d-public at web3d.org; x3dom-developers at lists.sourceforge.net 
> Subject: Re: [X3D-Public] [x3dom-developers] Fwd: [X3D] Comment: need  
> ability to import separate Javascript source library into embedded X3D  
> Script code 
>  
> John, 
>  
> Thanks for replying and contributing to the discussion. I hope I am  
> following your comments correctly. 
>  
> In X3D (not necessarily X3DOM), a Script node defines a new name space.  
> The only way to communication between functions in different Script  
> nodes is to pass events OR directly access the other node's events  
> (directAccess='TRUE'). If you were to read in a Script node in an  
> external X3D file (e.g., via GetX3dFromURL), then that Script node  
> would be in a separate namespace as above. 
>  
> Don's comment relates a desire to import JavaScript (formally  
> ECMAScript) into an existing Script node so that functions and data in  
> the imported file could be accessed directly via ECMAScript's standard  
> mechanisms (call, data access, etc.). This is a really important  
> feature for ECMAScript libraries. 
>  
> There was a previous comment that is a feature that allows this to  
> happen using 'required'. I cannot find that feature in the ECMAScript  
> Language Specification at  
> http://www.ecma-international.org/ecma-262/5.1/ If it is not in the  
> ECMAScript specification, then it is not supported in the X3D Script  
> node. The X3D specification development team did not consider the  
> impact of such a feature. If it is in the specification, then a review  
> of the specification needs to performed to make sure everything  
> operates as intended. 
>  
> Also the AJAX functions XHR* and XHttp* are not in the ECMAScript  
> specification so that it would not be possible to access the external  
> file and 'eval' it. 
>  
>  
> Leonard Daly 
>  
>  
>  
>  
>  
> How is it different than reading the url into a string say with ajax  
> and then eval'ling the string?  Perhaps I'm missing something. 
>  
> On Dec 7, 2014 6:47 AM, "John Carlson"  
> <yottzumm at gmail.com<mailto:yottzumm at gmail.com>> wrote: 
>  
> Oh, I see.  I didn't realize web browsers supported require.   This may  
> be a bigger change than you think.  However for X3D  server side,  it  
> might be useful for libraries. 
>  
> On Dec 7, 2014 6:39 AM, "John Carlson"  
> <yottzumm at gmail.com<mailto:yottzumm at gmail.com>> wrote: 
>  
> What about the url attribute for script? 
>  
> On Dec 7, 2014 6:35 AM, "John Carlson"  
> <yottzumm at gmail.com<mailto:yottzumm at gmail.com>> wrote: 
>  
> Eh, <script> doesn't support the src attribute???? 
>  
> On Dec 4, 2014 2:23 AM, "Don Brutzman"  
> <brutzman at nps.edu<mailto:brutzman at nps.edu>> wrote: 
> Comments on this issue welcome.  Seems like a big omission if indeed  
> there is no way for an author to load an external Javascript library  
> into a Script node internal to an X3D scene. 
>  
>  
> -------- Forwarded Message -------- 
> Subject: [X3D] Comment on Specification by "brutzman" 
> Date: Wed, 3 Dec 2014 09:14:09 -0800 
> From: Spec Feedback <spec-comment at web3d.org<mailto:spec-comment at web3d.org>> 
> To: x3d at web3d.org<mailto:x3d at web3d.org> 
>  
> Comment on 19777-1: JavaScript Binding - V3.3 
> 4 Concepts 
> http://www.web3d.org/documents/specifications/19777-1/V3.0/Part1/concepts.html 
>  
> ----------------- 
> No method currently exists to import source for an external Javascript 
> library into an embedded X3D Script node. 
>  
> The ECMAScript specification reserves keywords "import export" but does not 
> define functionality. 
> http://www.web3d.org/specifications/Ecma-262.pdf 
>  
> HTML supports multiple javascript libraries in the web page via the  element. 
> http://www.w3.org/TR/html401/interact/scripts.html 
> http://www.w3.org/TR/html5/scripting-1.html 
>  
> X3D needs a similar mechanism where an X3D Script author can use/reuse an 
> external Javascript library. 
> ----------------- 
>  
> Submitted on Wednesday, 2014,  December 3 - 9:14am 
> by brutzman (brutzman ) 
> IP: 205.155.65.226 
>  
>  
>  
> --  
> Leonard Daly 
> X3D Co-Chair 
> Cloud Consultant 
> President, Daly Realism - Creating the Future 
>  
> _______________________________________________ X3D-Public mailing list  
> X3D-Public at web3d.org  
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org 
 		 	   		  


More information about the X3D-Public mailing list