Skip to main content
Pkoel
Inspiring
September 27, 2016
Answered

Captivate 9, Responsive project, JavaScript Alert window

  • September 27, 2016
  • 2 replies
  • 840 views

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

This topic has been closed for replies.
Correct answer TLCMediaDesign

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?

2 replies

TLCMediaDesign
TLCMediaDesignCorrect answer
Inspiring
September 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?

Pkoel
PkoelAuthor
Inspiring
September 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

TLCMediaDesign
Inspiring
September 28, 2016

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

BDuckWorks
Inspiring
September 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.

Pkoel
PkoelAuthor
Inspiring
September 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