85 lines
3.2 KiB
HTML
85 lines
3.2 KiB
HTML
<html>
|
|
<!-- Padding to account for small screens of mobile devices -->
|
|
<style>
|
|
p {margin-top:48px;}
|
|
</style>
|
|
<head>
|
|
<title>Testing Alerts</title>
|
|
|
|
<script type="text/javascript">
|
|
function setInnerText(id, value) {
|
|
document.getElementById(id).innerHTML = '<p>' + value + '</p>';
|
|
}
|
|
|
|
function displayPrompt() {
|
|
setInnerText('text', prompt('Enter something'));
|
|
}
|
|
|
|
function displayPromptWithDefault() {
|
|
setInnerText('text', prompt('Enter something', 'This is a default value'));
|
|
}
|
|
|
|
function displayTwoPrompts() {
|
|
setInnerText('text1', prompt('First'));
|
|
setInnerText('text2', prompt('Second'));
|
|
}
|
|
|
|
function slowAlert() {
|
|
window.setTimeout(function() {
|
|
alert('Slow');
|
|
}, 200);
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
<h1>Testing Alerts and Stuff</h1>
|
|
|
|
<p>This tests alerts: <a href="#" id="alert" onclick="alert('cheese');">click me</a></p>
|
|
|
|
<p>This tests alerts: <a href="#" id="empty-alert" onclick="alert('');">click me</a></p>
|
|
|
|
<p>Let's make the <a href="#" id="prompt" onclick="displayPrompt();">prompt happen</a></p>
|
|
|
|
<p>Let's make the <a href="#" id="prompt-with-default" onclick="displayPromptWithDefault();">prompt with default happen</a></p>
|
|
|
|
<p>Let's make TWO <a href="#" id="double-prompt" onclick="displayTwoPrompts();">prompts happen</a></p>
|
|
|
|
<p>A <a href="#" id="slow-alert" onclick="slowAlert();">SLOW</a> alert</p>
|
|
|
|
<p>This is a test of a confirm:
|
|
<a href="simpleTest.html" id="confirm" onclick="return confirm('Are you sure?');">test confirm</a></p>
|
|
|
|
<p>This is a test of showModalDialog: <a href="#" id="dialog" onclick="showModalDialog('javascriptPage.html')">test dialog</a></p>
|
|
|
|
<p>This is a test of an alert in an iframe:
|
|
<iframe src="iframeWithAlert.html" name="iframeWithAlert"></iframe>
|
|
</p>
|
|
|
|
<p>This is a test of an alert in a nested iframe:
|
|
<iframe src="iframeWithIframe.html" name="iframeWithIframe"></iframe>
|
|
</p>
|
|
|
|
<p>This is a test of an alert open from onload event handler: <a id="open-page-with-onload-alert" href="pageWithOnLoad.html">open new page</a></p>
|
|
|
|
<p>This is a test of an alert open from onload event handler: <a id="open-window-with-onload-alert" href="pageWithOnLoad.html" target="onload">open new window</a></p>
|
|
|
|
<p>This is a test of an alert open from onunload event handler: <a id="open-page-with-onunload-alert" href="pageWithOnUnload.html">open new page</a></p>
|
|
|
|
<p>This is a test of an alert open from onclose event handler: <a id="open-window-with-onclose-alert" href="pageWithOnUnload.html" target="onclose">open new window</a></p>
|
|
|
|
<p>This is a test of an alert open from onclose event handler: <a id="open-new-window" href="blank.html" target="newwindow">open new window</a></p>
|
|
|
|
<div id="text"></div>
|
|
<div id="text1"></div>
|
|
<div id="text2"></div>
|
|
|
|
<p><select id="select" onchange="alert('changed');">
|
|
<option id="novalue" value="">Nothing selected</option>
|
|
<option id="value1" value="1">One</option>
|
|
<option id="value2" value="2">Two</option>
|
|
<option id="value3" value="3">Three</option>
|
|
</select></p>
|
|
<p><input id="input" onchange="alert('change fired');" value="onchange"/></p>
|
|
</body>
|
|
</html>
|