-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
31 lines (30 loc) · 1.02 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
<html>
<head>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<script src="index.js"></script>
<script>
function fetchReq() {
fetch('https://aurally.free.beeceptor.com/audio-loader').then(() => {
console.log('request successful');
})
}
function xhrReq() {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", 'https://aurally.free.beeceptor.com/audio-loader', true);
// xmlHttp.setRequestHeader('X-AUDIO-LOADER-OFF', 'yes');
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
console.log('request successful');
}
xmlHttp.send(null);
}
</script>
</head>
<body style="background: #efefef;">
<div>
<button onclick="fetchReq()">Fetch</button>
<button onclick="xhrReq()">XHR</button>
</div>
</body>
</html>