Jump to content

Include external javascript in plugins


reggi

Recommended Posts

reggi
 

Hi everyone,

 

I'm working on a new plugin for Emby to view some nice statistics of the library and users.

 

At the moment, I have a very basic webpage with some data (total movies, movies viewed, genres + count, ...) and I want to include some nice charts so I have a better visual representation of the data. SO I tried to include a couple of lightweight Javascript libraries for visualising chars (d3.js, chartist.js, ...) but for some reason the scripts don't work.

 

I tried to add my script in the <head> tags but then it isn't even loaded in the HTML page. So I include the follwing <script> in the body tags but that doesn't work either.

<script src="http://d3js.org/d3.v3.min.js"charset="utf-8"></script>

 

I check my network traffic and it seems that the files are never loaded. So my question, is there a reason why external javascript files are blocked/not loaded in plugin pages?

 

Thanks,

Reggi

Link to comment
Share on other sites

Hi, content outside of your page element is ignored. Instead of loading it in the markup, load it in javascript using require.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...