Skip to main content
Inspiring
October 23, 2017
Answered

CP9 - External java library ref not working in On Enter action.

  • October 23, 2017
  • 1 reply
  • 616 views

CP 9.0.2.437

HTML5 Output only

Hello,

I want to use an external java library.

I have it working successfully by putting a reference to it in my index.html file.

<script  src="../../java_library/my_java_library.js"></script>

However, I would rather be able to reference the library from within the project.

I found the code below in the forum and have placed it in the 'On Enter' action of the first slide.

Unfortunately it did not work, even by using either relative or absolute addressing.

$(‘body’).append(‘<script src=”http://myservername/myfolder/mylibrary.js” async=”false”></script>’);

If anyone can suggest where I am going wrong I would appreciate it.

Thank you

Peter

    This topic has been closed for replies.
    Correct answer TLCMediaDesign

    Check out this thread. One of these will surely work.

    javascript - Can't append <script> element - Stack Overflow

    1 reply

    TLCMediaDesign
    Inspiring
    October 23, 2017

    You can't use that example literally, it doesn't exist.

    If I had a js file to link on my site it could be:

    $(‘body’).append(‘<script src=”https://www.tlcmediadesign.com/scripts/cp.js" async=”false”></script>’);

    You need to put the path to your file.

    Inspiring
    October 24, 2017

    TLC,

    Thank you for the feedback.

    In my original post I removed the real server/folder/file path information as that is sensitive, and I replaced it with the dummy code.

    So I am using a script exactly as you have suggested, but the it does not work.

    Peter.

    TLCMediaDesign
    TLCMediaDesignCorrect answer
    Inspiring
    October 24, 2017

    Check out this thread. One of these will surely work.

    javascript - Can't append <script> element - Stack Overflow