Results 1 to 5 of 5

Thread: How to load a 3rd party JS library into a widget for a plugin?

  1. #1
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,829

    How to load a 3rd party JS library into a widget for a plugin?

    Hello,

    Let's say we have a custom plugin which need to load a 3rd party library into a widget tab

    HTML Code:
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    How to complete it? The library does not seem to get loaded in a widget panel.
    Alex Grebenschikov

    - You can hire me on www.poralix.com to work on your server
    - Follow and like @Poralix on Facebook

  2. #2
    Join Date
    Mar 2011
    Posts
    66
    Add it to app.html
    I have a custom.css in app.html But avoid overwrite the app.html on skin update. It's better to create a custom skin folder like named Evo (I'm using this method too)

  3. #3
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,829
    Thanks for your suggestion. It seems no JS code can run from within a widget. Or I miss anything obvious.

    I'm referring to this new feature: https://www.directadmin.com/features.php?id=2254
    Alex Grebenschikov

    - You can hire me on www.poralix.com to work on your server
    - Follow and like @Poralix on Facebook

  4. #4
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,829
    Found https://www.directadmin.com/features.php?id=2254 :

    To avoid JS conflicts with the skin, and to satisfy the quick page loads, it's likely simplest to use an iframe in main.html, and load your other page inside that iframe.
    So I will try it and update with results.
    Alex Grebenschikov

    - You can hire me on www.poralix.com to work on your server
    - Follow and like @Poralix on Facebook

  5. #5
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,829
    Yes, iframe solved the issue.
    Alex Grebenschikov

    - You can hire me on www.poralix.com to work on your server
    - Follow and like @Poralix on Facebook

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •