forked from niutech/showModalDialog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
33 lines (33 loc) · 1.17 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html>
<head>
<title>showModalDialog polyfill demo</title>
</head>
<body>
<h1>showModalDialog polyfill demo</h1>
<form action="">
<p>
<input id="button1" type="button" value="Show Modal Dialog using yield">
</p>
<p>
<input id="button2" type="button" value="Show Modal Dialog using eval">
</p>
</form>
<iframe src="https://ghbtns.com/github-btn.html?user=niutech&repo=showModalDialog&type=watch&count=true" height="30" width="118" frameborder="0" allowTransparency="true"></iframe>
<script src="showModalDialog.js"></script>
<script>
document.getElementById('button1').addEventListener('click', function() {
spawn(function*() {
var ret = yield window.showModalDialog("demo-modal.html", "some argument", "dialogWidth:500px;dialogHeight:200px");
alert("Returned from modal: " + ret);
});
});
</script>
<script>
document.getElementById('button2').addEventListener('click', function() {
var ret = window.showModalDialog("demo-modal.html", "some argument", "dialogWidth:500px;dialogHeight:200px");
alert("Returned from modal: " + ret);
});
</script>
</body>
</html>