Skip to content

Including external javascript in html #15

Answered by ZuperZee
dean2140 asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not gonna add anything to make importing external libraries directly to the panel easier.

If you would like to use external libraries you could use dynamic import, but a bundler like htmlgraphics-svg-bundler-template is probably easier to work with.

onInit

async function init() {
  await import('https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.slim.js');

  jQuery('<div>Hello, World!</div>').appendTo(htmlNode.lastElementChild);
}

init();

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@dean2140
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by ZuperZee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants