-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
153 lines (118 loc) · 3.37 KB
/
index.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xml+html" />
<link rel="icon" type="image/png" href="assets/oxhr-favicon-32.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Oxhr demo</title>
<style>
body {
margin: 0;
background: #ebebeb;
}
a {
color: steelblue;
}
table {
width: 100%;
}
table td,
table th {
border: 0;
border-bottom: 1px solid #a4a4a4;
text-align: center;
background-color: #e0e0e0;
}
table td {
background-color: #fdfdfd;
}
fieldset {
border: 1px solid grey;
box-shadow: 2px 2px 5px silver;
padding: 20px;
margin-bottom: 2em;
}
input {
display: block;
margin: 0.5em 0;
}
.container {
max-width: 700px;
margin: 0 auto;
padding: 20px;
border: thin solid #bababa;
box-shadow: 3px 3px 5px #bababa;
background-color: #fdfdfd;
color: #404040;
font-family: "Open Sans", sans-serif;
font-size: 14px;
line-height: 1.4;
}
</style>
<script src="dist/demo.js" type="module"></script>
</head>
<body>
<div class="container">
<h1>A simple Oxhr demo</h1>
<em>(See console log for detailed information)</em>
<br /><br />
<fieldset>
<label for="loadProgress">File progress:</label>
<progress id="loadProgress" min="0" max="100" value="0"> 0% </progress>
<label for="loadBytes">Bytes loaded:</label>
<span id="loadBytes"></span>
<br /><br />
<input type="button" id="startButton" value="Start large JSON download" />
<input type="button" id="abortButton" value="Abort JSON download" />
<br />
Each click on start re-uses one and the same Oxhr instance. You may want to slow
down the internet speed in browser developer tools.
</fieldset>
<fieldset>
<input type="button" id="swButton" value="Fetch a StarWars character" />
<br />
Each click creates a new Oxhr instance, try clicking multiple times.
</fieldset>
<h3>XMLHttpRequest.readyState</h3>
<table>
<thead>
<tr>
<th>Value</th>
<th>State</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>0</code></td>
<td><code>UNSENT</code></td>
<td>Client has been created. <code>open()</code> not called yet.</td>
</tr>
<tr>
<td><code>1</code></td>
<td><code>OPENED</code></td>
<td><code>open()</code> has been called.</td>
</tr>
<tr>
<td><code>2</code></td>
<td><code>HEADERS_RECEIVED</code></td>
<td><code>send()</code> has been called, and headers and status are available.
</td>
</tr>
<tr>
<td><code>3</code></td>
<td><code>LOADING</code></td>
<td>Downloading; <code>responseText</code> holds partial data.</td>
</tr>
<tr>
<td><code>4</code></td>
<td><code>DONE</code></td>
<td>The operation is complete.</td>
</tr>
</tbody>
</table>
<br /><br /><br /><br />
<a href="https://github.com/Amarok24/Oxhr" target="_blank">GitHub repository</a>
</div>
</body>
</html>