Forum Discussion
Exit or Close Button?
Hi everyone, Just to highlight how critical a close button within the content actually is, here's a small test to show you how much can actually be achieved in an onbeforeunload handler. The source code is linked to the page below, so feel free to download it and create your own test. As you'll see Internet Explorer is the only browser that will give you near infinite time to execute requests when someone closes the browser.
http://www.andrewsmith.com.au/delay.html
While you might be finalising before the browser closes if the student completes the content, what about the scenario where someone wants to exit/bookmark and return? Without a clear exit button within the content, the only way to do this is onunload or onbeforeunload.
The time your browser will wait for whatever calls you make within these handlers varies per browser, but most only wait a very short period of time. If you intend to set the session time, the score and the exit type for example in sequential requests (SCORM requires synchronous ajax), in a high latency environment, it's highly likely that 1 or all of these will fail.
So aside from the human side of this issue (be kind and let people know that they can safely save and exit) it simply isn't reasonable to expect that any synchronous ajax will complete during window close.
Andrew
Related Content
- 5 days ago
- 6 months ago