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

Captivate 9 - JavaScript stored in a separate file

Contributor ,
Sep 19, 2016 Sep 19, 2016

Hello All,

  I am very new to using Java script in Captivate. I have seen numerous suggestions about placing the code in a separate file and referencing the function in the Captivate JavaScript  window. I know this will seem like a vague question, but: How do I do that? What is the name of the file, where do I place it in the directory path, and where should it go if I am creating SCORM modules? I can find very little help on the Captivate sites. Does a book or specific site exist for this type of learning?

Sincerely,

Peter

1.1K
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

correct answers 1 Correct answer

People's Champ , Sep 19, 2016 Sep 19, 2016

The best option is to place the include in the html template;

C:\Program Files\Adobe\Adobe Captivate 9 x64\HTML\index.html

Place your include as shown in the bold text:

<!DOCTYPE html>
<html lang="en">
<head>
<meta name='viewport' content='initial-scale = 1, minimum-scale = 1, maximum-scale = 1'/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>@MOVIETITLE</title>
<style type="text/css">#initialLoading{background:url(asse

...
Translate
Participant ,
Sep 19, 2016 Sep 19, 2016

After publishing a file, open your index.html (or index_scorm.html if you published scorm version) and add the following line in the <head> section:

<script src="name_of_your_script_ here.js"></script>
(please note - this is assuming your js file is in the same folder as your html file.  If the js file resides in a different folder, you'll have to point to it by typing src="folder_name/name_of_your_script_here.js"

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 ,
Sep 19, 2016 Sep 19, 2016

The best option is to place the include in the html template;

C:\Program Files\Adobe\Adobe Captivate 9 x64\HTML\index.html

Place your include as shown in the bold text:

<!DOCTYPE html>
<html lang="en">
<head>
<meta name='viewport' content='initial-scale = 1, minimum-scale = 1, maximum-scale = 1'/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>@MOVIETITLE</title>
<style type="text/css">#initialLoading{background:url(assets/htmlimages/loader.gif) no-repeat center center;background-color:#ffffff;position:absolute;margin:auto;top:0;left:0;right:0;bottom:0;z-index:10010;}</style>
<script src="assets/js/your_javascript.js"></script>
<script>

function initializeCP()

Then put your JavaScript file here:

C:\Program Files\Adobe\Adobe Captivate 9 x64\HTML\assets\js\

This way it will always publish.

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 ,
Sep 19, 2016 Sep 19, 2016

Hello and thanks for the reply. Do you know of a book or web resource where these ideas are documented? I will be attending the 2016 DevLearn conference in Las Vegas. Is there a session that you would recommend I attend to learn more?

Sincerely,

Peter

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 ,
Sep 19, 2016 Sep 19, 2016

I don't know of any book. I also have not looked at the DevLearn sessions.

We may be doing online seminars or possibly an eBook specifically for JavaScript and Captivate.

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
Participant ,
Sep 19, 2016 Sep 19, 2016

I would be very interested in either the seminars or the book!  Is there a way for me to sign up for a notification if either will come to life?

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 ,
Sep 19, 2016 Sep 19, 2016
LATEST

I you sign up for free stuff at our website you will be notified when available.

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