Skip to main content
Participant
August 12, 2023
Question

Help with a close window script button

  • August 12, 2023
  • 1 reply
  • 219 views

Hi guys, 

Im using a button at the end of a course to close the window or close the course, however, is not working on the platform I'm using, I already try by adding the interaction--Click--close the course, but nothing.

now I just added the script 

 

function cerrarCurso() {
window.close();
if (window.self !== window.top) {
window.parent.close();
}
}

document.getElementById('Botón_46').addEventListener('click', cerrarCurso);

 

And still nothing, it does not close with the button, I have to close the window manually.

 

I'm using the recent Captivate (vs12)

 

Thanks!

    This topic has been closed for replies.

    1 reply

    RodWard
    Community Expert
    Community Expert
    August 13, 2023

    The JavaScript API for Captivate 12 is radically different from that of all earlier versions.  So using JS that worked in Captivate 2019 is not necessarily going to work in Captivate 12.

     

    Just out of interest, have you tried using Captivate's own Advanced Actions to close the course window using the Exit Course command?  That would sound a lot simpler to me.  

    Lilybiri
    Legend
    August 13, 2023

    @RodWard "Advanced action" is no longer in the glossary of CP2023. I am struggling trying to transfer the AA and especially the Shared actions using the Interaction tool. Know that I use the advanced action as 'storyboard' for those interactions.