Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Dec 03, 2015 Dec 03, 2015

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?

TOPICS
Advanced
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 17, 2017 Aug 17, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 26, 2017 Aug 26, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Aug 28, 2017 Aug 28, 2017
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources