Skip to main content
Participant
October 12, 2017
Answered

Web object Javascript with Captivate 9

  • October 12, 2017
  • 2 replies
  • 864 views

Hi All,

Really stuck here and hoping someone can help or point me in the right direction.

I have created a responsive HTML page which I have added as a web object to my Captivate project.  What I would like to do is call the Captivate JavaScript functions window.cpAPIInterface.....; from my HTML web object to advance the project to the next slide. This may sound unconventional but i am looking to give my project to look and feel of a website so i would have separate HTML web objects on each slide that would be linked through the Javascript calls, allowing the normal tracking of any Captivate project.

Thanks

    This topic has been closed for replies.
    Correct answer TLCMediaDesign

    I was hoping this could be added to a html button using the onclick  function like below but nothing happens.

    <button type="button" onclick="parent.cp.playMovie()">Continue</button>


    I use:

    window.parent.window.cpAPIInterface.next();

    2 replies

    Participant
    October 12, 2017

    Thanks Guys, all were correct.

    I had been trying to run the course locally and the Javascript wasn't working for some reason.  I  uploaded the course to the LMS  and added all 3 of your responses to an onclick event and Im happy to say it worked.

    Thanks for your help.

    ankits61431843
    Inspiring
    October 12, 2017

    You can advance the slide by using

    parent.cp.playMovie()

    in your web object html file

    ankits61431843
    Inspiring
    October 12, 2017

    If you want to go to next slide. Please use below line in your web object html file

    parent.cp.goToNextSlide()

    Participant
    October 12, 2017

    I was hoping this could be added to a html button using the onclick  function like below but nothing happens.

    <button type="button" onclick="parent.cp.playMovie()">Continue</button>