mirror of
https://github.com/denoland/deno.git
synced 2025-09-29 13:44:47 +00:00
feat: window.onunload (#3023)
This commit is contained in:
parent
d32f39f2ec
commit
c920c5f62a
9 changed files with 126 additions and 20 deletions
|
@ -1,8 +1,11 @@
|
|||
import { assert } from "../../../js/deps/https/deno.land/std/testing/asserts.ts";
|
||||
import "./nest_imported.ts";
|
||||
window.addEventListener(
|
||||
"load",
|
||||
(e: Event): void => {
|
||||
console.log(`got ${e.type} event in event handler (imported)`);
|
||||
}
|
||||
);
|
||||
|
||||
const handler = (e: Event): void => {
|
||||
assert(!e.cancelable);
|
||||
console.log(`got ${e.type} event in event handler (imported)`);
|
||||
};
|
||||
|
||||
window.addEventListener("load", handler);
|
||||
window.addEventListener("unload", handler);
|
||||
console.log("log from imported script");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue