I made the “Exit” button works correctly in test mode.
However when exporting to Scorm, the button closes the project but does not close the browser window.
Here is the code used:
Is there a script to close the window?
The script window.close (); only helps to close the browser tab which is opened by script. Therefore, you should configure to open your course in a new window/tab when uploading the SCORM package to the LMS for the script to work.
Yes, even when opening in a new window, the script does not work. The project just stops working but the window is not closed.
I managed to close the tab using the following command:
var tab = window.open(window.location,"_top");
If so, the course is embedded in an iframe by your LMS.
If the top window and the iframe have the same domain, you can use