Skip to main content
Participating Frequently
December 8, 2019
Question

Call external function

  • December 8, 2019
  • 1 reply
  • 692 views

Hi all,

 

looking for some guidance. I am trying to call a js function from within captivate to an external js function on the page. 
i have a button on a slide which evokes a function, save();  

On my html page where the captivate presentation resides, I have a script and a js function called save();

However, the function is not called. I get an error on the console saying save(); is undefined when i click the button on the slide. 

I m thinking I may have to add the script on the html page of the captivate project after its published, but i thought my way should work. Any advice?

 

This topic has been closed for replies.

1 reply

kdmemory
Inspiring
December 8, 2019

Hi Mufakkir,

from within Captivate try to call your function with

window.save();

But actually, consider naming your external function with a more securely unique name, like saveMyData or something along these lines instead of using such generic functional names like open, save, copy etc.

Klaus

MufakkirAuthor
Participating Frequently
December 8, 2019

Thanks Klaus. Will try it out. By the way the save(); name was just an example. My actual function is called something different. 

Thanks