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

Javascript using the OnUnload Event

New Here ,
Sep 16, 2014 Sep 16, 2014

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.

554
Translate
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
Participant ,
Jun 03, 2015 Jun 03, 2015

Looking into the same issue here...

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

Translate
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
People's Champ ,
Jun 04, 2015 Jun 04, 2015
LATEST

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

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

Translate
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