IE, onbeforeunload event, and Javascript calls
Copy link to clipboard
Copied
Due to circumstances beyond my control, I've been painted into a corner and wondering if anyone has any information on how Captivate initiates or executes javascript during runtime - like from a button event.
Scenario...
I have a client that absolutly wants a dialog/alert to appear when the user attempts to close the browser window. However, after completing certain Captivate activities, the dialog can be disabled. If you've ever attempted this kind of thing, there are two browser events (speaking specifically about IE 7/8 which is my target browser) - onbeforeunload and onunload that can be used to trigger the display of a dialog when the user tries to close the browser window/tab. Both of these are somewhat problimatic but generally workable.
These events can be triggered by a dizzying array of other events (http://msdn.microsoft.com/en-us/library/ie/ms536907%28v=vs.85%29.aspx). The problem I'm experiencing is that somehow when attempting to execute a javascript call from Captivate to disable the dialog, it's triggering the onbeforeunload event BEFORE executing the javascript from Captivate. I'm also experiencing the same issue with a "send e-mail to" action.
Any possible ideas why this might be occuring? Using Captivate 5.5.
Have something to add?

