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

Help with a close window script button

Community Beginner ,
Aug 12, 2023 Aug 12, 2023

Copy link to clipboard

Copied

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!

Views

102

Translate

Translate

Report

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
Community Expert ,
Aug 12, 2023 Aug 12, 2023

Copy link to clipboard

Copied

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.  

12_ExitCourse.png

Votes

Translate

Translate

Report

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
Community Expert ,
Aug 13, 2023 Aug 13, 2023

Copy link to clipboard

Copied

@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. 

Votes

Translate

Translate

Report

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
Community Beginner ,
Aug 14, 2023 Aug 14, 2023

Copy link to clipboard

Copied

LATEST

Yes, I had, but it doesn't close.

Votes

Translate

Translate

Report

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