Javascript using the OnUnload Event
Copy link to clipboard
Copied
Hello,
I have created an E-learning Course using captivate, at the end of the course I want the users to give me a feedback,
So I have to write a javascript code which will execute whenever the user clicks on the close button of the browser
I have used the onunload function and added it to the slide on enter.
onUnload=window.open('http://www.google.com');
onbeforeunload=window.open('http://www.google.com');
This does work but not when the users click on the close button.
Can anyone help me with this requirement.
Copy link to clipboard
Copied
Looking into the same issue here...
Why can't i "execute an action" when the page is closed?
Copy link to clipboard
Copied
That script would need to be in the html on the body tag.
<body onunload="window.open('http://www.google.com');">

