Giter VIP home page Giter VIP logo

Comments (6)

gwhitney avatar gwhitney commented on June 26, 2024

I have found a workaround that leads to my .wrl file displaying correctly:

import "https://code.jquery.com/jquery-3.7.1.js"

jQuery.getScript('https://create3000.github.io/code/x_ite/latest/x_ite.js', () => {
   const canvas = X3D.createBrowser()
   const site = $('a[href^="http"]')
   canvas.setAttribute('src', site.attr('href'))
   return site.after(canvas)
})

but still it would be ideal if x_ite.js did not become confused about the location of its assets when it is (es6) imported. Thanks for confirming the issue and any future progress you make on resolving it.

from x_ite.

create3000 avatar create3000 commented on June 26, 2024

Unfortunately X_ITE is not yet made to be loaded via ES6 import statement, so as a module. The recommended way to include it is via the script element and that is also, I believe, what jQuery does.

<script src="https://create3000.github.io/code/x_ite/latest/x_ite.min.js"></script>

from x_ite.

create3000 avatar create3000 commented on June 26, 2024

With new version, probably released on Sunday, this will be possible:

import "https://code.jquery.com/jquery-3.7.1.js";
import X3D from "https://create3000.github.io/code/x_ite/latest/x_ite.mjs";

const
   canvas  = X3D .createBrowser (),
   browser = canvas .browser;

$("body")
   .append (canvas)
   .append ($("<p></p>") .text ("X_ITE loaded as JavaScript module."));

browser .loadURL (new X3D .MFString ("https://create3000.github.io/media/examples/Geometry2D/Disk2D/Disk2D.x3d"));

Please note: the extension of the imported x_ite file is .mjs.

from x_ite.

gwhitney avatar gwhitney commented on June 26, 2024

Terrific, looking forward to it, thanks.

from x_ite.

create3000 avatar create3000 commented on June 26, 2024

Have right now released a new version 8.12.0 with ES module support.

from x_ite.

gwhitney avatar gwhitney commented on June 26, 2024

Works for me :)

from x_ite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.