HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

JavaScript Tutorial - "unload" event | Detect when the browser window has closed

43,135 views November 1, 2018 5:25

Watch on YouTube
Channeldcode

Description from the creator

By using the "unload" event in JavaScript you are able to detect when the window has closed. In the case of an iframe, it is possible to detect when the src attribute has been removed or changed.

In this video we take a look at an example of the "unload" event in the case of an iframe, where we send a message to the parent window when the child window (within the iframe) gets un-loaded.

Support me on Patreon:
patreon.com/dcode - with enough funding I plan to develop a website of some sort with a new developer experience!

For your reference, check this out:
developer.mozilla.org/en-US/docs/Web/Events/unl…

Follow me on Twitter @dcode!

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

About this tutorial

dcode published this 5:25 video tutorial on November 1, 2018. It has been watched 43,135 times on YouTube.

Channel
dcode
Category
Education
Duration
5:25
Published
November 1, 2018
Views
43,135
Likes
243

Share

This tutorial in other languages