Skip to main content
Participant
September 16, 2014
Question

Javascript using the OnUnload Event

  • September 16, 2014
  • 2 replies
  • 579 views

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.

This topic has been closed for replies.

2 replies

TLCMediaDesign
Inspiring
June 4, 2015

That script would need to be in the html on the body tag.

<body onunload="window.open('http://www.google.com');">

osbornsm
Inspiring
June 3, 2015

Looking into the same issue here...

Why can't i "execute an action" when the page is closed?