[x3d-public] loadURL browser object SAI function proposal

John Carlson yottzumm at gmail.com
Mon May 28 14:47:18 PDT 2018


Well, when I take loadJS out of my code, it ceases to function?

I’m frankly puzzled.

John

Sent from Mail for Windows 10

From: Andreas Plesch
Sent: Monday, May 28, 2018 5:36 PM
To: John Carlson
Cc: X3D Graphics public mailing list
Subject: Re: [x3d-public] loadURL browser object SAI function proposal

Not sure if loadJS would be a good idea: It is literally one line:
browser.replaceWorld(browser.createX3DfromJS(jsobject))
Error/null checking needs to occur in both of these functions anyways.
loadURL is mainly available to hide Promises.

-Andreas


On Mon, May 28, 2018 at 5:06 PM, John Carlson <yottzumm at gmail.com> wrote:
> I added loadJS, too.  I can probably take it out, since it doesn’t use an
> asynchronous nature.  However, it is convenient.
>
>
>
>
>
> Here’s an example:
>
>
>
> https://coderextreme.net/X3DJSONLD/src/main/html/prototypes.html
>
>
>
> (note it uses an x3dom-full.debug.js on the site).
>
>
>
> John
>
>
>
> Sent from Mail for Windows 10
>
>
>
> From: Andreas Plesch
> Sent: Monday, May 28, 2018 4:01 PM
> To: X3D Graphics public mailing list
> Subject: [x3d-public] loadURL browser object SAI function proposal
>
>
>
> Table 7.3 list the browser object SAI functions for JS:
>
>
>
> http://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html#t-FunctionsBrowserObject
>
>
>
> So in order load a new scene from a URL into the current browser, one
>
> first creates a new x3dscene from the URL and then replaces the
>
> current world with the new scene.
>
>
>
> John and I are adding these browser SAI functions more formally to
>
> x3dom, along with supporting json as string, url, or object using
>
> John's parser and expander. It works pretty well but it turned out to
>
> be useful to add an additional function: loadURL(url).
>
>
>
> It just just combines the two steps into one. Apart from addressing
>
> the most common use case for these functions by making this easier,
>
> loadURL also hides the asynchronous nature of downloading which is
>
> strongly preferred these days. An app does not block while potentially
>
> downloading slowly, or finally timing out. The function knows
>
> internally when the download is available and then replaces the world.
>
> In x3dom there is then another user definable function which is called
>
> when the world is completely loaded. I think there is an equivalent
>
> event in x3d. So the function is still asynchronous but allows for
>
> familiar methods to proceed when the scene is available.
>
>
>
> Practically, for x3dom users, having loadURL means not having to know
>
> or learn Promises and still have a performant, and easy way to load a
>
> new scene.
>
>
>
> Here is an example which loads new scenes in various ways:
>
> https://rawgit.com/x3dom/x3dom/browserSAI/test/functional/runtime.html#
>
> The expanded world option loads remote json, after expanding protos.
>
>
>
> My question is then if other x3d browser have such a convenience
>
> loadURL SAI function, potentially asynchronous, and if there is an
>
> informal standard to follow.
>
>
>
> -Andreas
>
>
>
> --
>
> Andreas Plesch
>
> Waltham, MA 02453
>
>
>
> _______________________________________________
>
> x3d-public mailing list
>
> x3d-public at web3d.org
>
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>



-- 
Andreas Plesch
Waltham, MA 02453

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20180528/90802415/attachment.html>


More information about the x3d-public mailing list