Lately I’ve been working on a Dart interop package for Babylon, and while it’s not essential, I would like to be able to load the Babylon js file from the package via code on demand at runtime.
Problem is, nothing I have tried has worked. My current method is creating a script element, setting the src, appending it to the document head and waiting for onload to fire, which works with a test script I wrote to contrast, but not with Babylon.
Adding it to the page manually via the chrome console does work, but appending it from code (dart script or js via console) does not, which has me confused. No error is generated, so it’s not that it’s a wrong url or anything…
I don’t understand enough about how the code loads normally to know exactly what’s going wrong with it, but wondered if anyone here has advice how to proceed.
Ultimately if it just can’t be done it can still be added to the page manually, so no huge loss, but that’s another step and kind of a drag.