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

Captivate 9, Responsive project, JavaScript Alert window

Contributor ,
Sep 27, 2016 Sep 27, 2016

Hello Friends,

  I am using Captivate 9 to create a responsive project. My plan was to use Alert boxes to convey information to the user. I created a simple java script file and included it in the assets/js folder:

var ASBtest = function (name)

{

  this.name = name;

    alert(this.name + 'Created');

};

ASBtest.prototype.sayHello = function()

{

  alert("Hello, I'm " + this.name);

};

I changed the index.html file to include the JavaScript folder.

In my Captivate project I have the following execute on a button click:

var mytest = new ASBtest('Billy');

mytest.sayHello();

I should see two alert windows: one when the instance is created, and then again when the method is invoked. I only see the last one in the invoked method. Why do I not get the first?

Sincerely,

Peter

651
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 28, 2016 Sep 28, 2016

Try using console.log() instead and see what you get. Captivate suppresses alerts into it's own custom message box.

Also, why are you using Prototype, are you planning on adding more methods?

Translate
Advisor ,
Sep 27, 2016 Sep 27, 2016

Are you planning to test this with users?

Our learners would likely find the interruptions as an annoyance.

I'd suggest you just use an occasional 'Continue' button. When you introduce it, have the narrator state "we've paused the course, click the continue button when you are ready..."

And only add the voice the first few times, then the button alone should be enough.

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

Hi BDuckWorks,

  I appreciate the suggestions. I am only doing this to test the functionality and wanted to make sure I was seeing the right reactions to my codding.

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

Try using console.log() instead and see what you get. Captivate suppresses alerts into it's own custom message box.

Also, why are you using Prototype, are you planning on adding more methods?

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

Hello TLC,

  Thank you for the suggestion, I give it a try. My plan was to add additional methods to the class and that is why I chose Prototype. I welcome your suggestions if there is a better way; I am very new to this.

As a side note, will you or your company be offering any training session at the November DevLearn conference?

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

No, unfortunately we won't be a DevLearn, we are working on our course though.

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