Base: Add a simple test page for window.prompt

The window prototypes alert, confirm, and prompt must "pause" execution
until a response is received from the user. This test page is meant to
ensure that a timeout queued before a prompt is not executed until after
that prompt is closed.
This commit is contained in:
Timothy Flynn 2022-11-15 15:24:43 -05:00 committed by Linus Groh
parent 4aeb1ffc12
commit 894bddf62c
Notes: sideshowbarker 2024-07-17 04:25:37 +09:00
2 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<pre id=message></pre>
<script>
const closed = (message) => {
console.log(message);
document.getElementById('message').innerHTML = `Message: "${message}"\n`;
};
setTimeout(() => { console.log('This must not appear until after the prompt is closed.'); }, 1000);
closed(prompt("Hello friends!"));
</script>
</body>
</html>

View file

@ -167,6 +167,7 @@
<li><a href="events.html">simple DOM events</a></li>
<li><a href="dom.html">simple DOM JS</a></li>
<li><a href="alert.html">alert()</a></li>
<li><a href="prompt.html">prompt()</a></li>
<li><a href="qsa.html">querySelectorAll()</a></li>
<li><a href="innerHTML.html">innerHTML()</a></li>
<li><a href="demo.html">fun demo</a></li>