Skip to main content
Known Participant
December 3, 2015
Question

how do you embed jquery in a Captivate project so that other objects and slides can call the library?

  • December 3, 2015
  • 3 replies
  • 1757 views

Hi, our company is creating a course shell using Captivate 9. We need to be able to embed jquery into the project template so that a student can deploy a  training environment for hands-on practice exercises. Our LMS programmer has created javascript code to interface between the LMS API and the training environment API. We also need this to be an easy enough solution so that non-programmers who will create new course shells using this template do not have to deal with adding code to the published .htm file. Any ideas, suggestions?

This topic has been closed for replies.

3 replies

TLCMediaDesign
Inspiring
August 28, 2017

jQuery is already linked to a published Captivate project a long as it is HTML5. You don't have to do anything.

papaintegrator
Inspiring
August 27, 2017

Hi Kris,

Were you able to implement this solution?  Let me know if there are any challenges. Using this solution you will be able to initite/embed jQuery in the start of the course and then write jQuery based scripts throughout the course for all slides and objects.

/best

papaintegrator
Inspiring
August 18, 2017

In Captivate project, on the first slide, go to Actions > On Enter > Execute JavaScript

You can use any of these two scripts:

1.

var scriptLink = '<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>'

$(scriptLink).appendTo("head")

2.

var script = document.createElement('script');
script
.type = 'text/javascript';
script
.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js';
document
.getElementsByTagName('head')[0].appendChild(script);

/best