Skip to main content
Inspiring
Oct 23, 2017 3:00 PM UTC
Answered

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

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 is closed to new replies. Start a new post to keep the conversation going.
    TLCMediaDesign
    TLCMediaDesignCorrect answer
    Inspiring
    Oct 24, 2017 7:00 PM UTC

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

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

    4 replies

    TLCMediaDesign
    Inspiring
    Oct 23, 2017 7:41 PM UTC

    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.

    Translate
    Inspiring
    Oct 24, 2017 7:32 AM UTC

    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.

    Translate
    TLCMediaDesign
    TLCMediaDesignCorrect answer
    Inspiring
    Oct 24, 2017 7:00 PM UTC

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

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

    Translate