-
Notifications
You must be signed in to change notification settings - Fork 1
/
echo.html
40 lines (34 loc) · 820 Bytes
/
echo.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
34
35
36
37
38
39
40
<!DOCTYPE html>
<html><head></head>
<body>
<style type="text/css">
body { margin: auto; width: 100%; }
.title { margin: 20; padding: 20; font-size: 42; font-weight: bold; text-align: center; }
div.centre {
background: gray;
width: 700px;
display: block;
margin-left: auto;
margin-right: auto;
}
</style>
<div class="title">test</div>
<p>
<div class="centre" id="result"></div>
<script>
window.onload = function() {
if (typeof echo === 'undefined') {
document.title = 'Fail';
console.log("no echo support");
return;
}
var errorCallBack = function(error) {
document.title = 'Fail';
console.log(error);
}
echo.hi("Hello World!").then(function(result) {
document.getElementById("result").innerHTML = result;
}, errorCallBack);
}
</script>
</body></html>