-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
65 lines (58 loc) · 1.33 KB
/
test.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html>
<head>
<style>
.block {
text-align: center;
background: aliceblue;
border: #a0a0a0 1px solid;
margin: 20px;
height: 600px;
}
.block:before {
content: 'block';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -0.25em;
background: gray;
}
.centered {
display: inline-block;
vertical-align: middle;
width: 300px;
padding: 10px;
background: #f5f5f5;
}
</style>
</head>
<body>
<div id="d" class="block">
<div class="centered">
some text<br>
But he stole up us again
and suddenly
</div>
</div>
<script type="text/javascript">
function loadXMLDoc(){
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readyState == 4){
if (xmlhttp.status == 200){
document.getElementById("d").innerHTML = xmlhttp.responseText;
}
else if (xmlhttp.status == 400){
alert("There was an error 400");
}
else {
alert('something else other than 200 was returned');
}
}
}
xmlhttp.open("GET", "test.html", true);
xmlhttp.send();
}
loadXMLDoc();
</script>
</body>