A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/dom/Element/unload below:

unload ยท WebPlatform Docs

unload Overview Table Synchronous No Bubbles No Target dom/Element Cancelable No Default action

## Examples

This example shows how to use the onunload event to run script when the window object has been unloaded.

<head>
<script type="text/javascript" for="window" event="onunload">
    alert("The onunload event fired for the window object.");
</script>
<script type="text/javascript">
    function fnRelocate()
    {
    location.href="/workshop/samples/author/dhtml/refs/onunloadEX_target.htm";
    }
</script>
</head>
<body>
<input type="button" value="Go To Page 2" onclick="fnRelocate()">
</body>

View live example

Notes Remarks

If you call window.open from this event, the Pop-up Blocker feature in Microsoft Internet Explorer 6 prevents the pop-up window from appearing. Removes the object or document from the browser window. To invoke this event, do one of the following:

For security reasons, the unload event does not open modeless dialog boxes, such as those created with the alert method. This changes affects webpages displayed in IE9 Standards mode or later document modes. The pEvtObj parameter is required for the following interfaces:

Standards information See also Related pages Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4