-
Notifications
You must be signed in to change notification settings - Fork 4
/
tests.html
87 lines (78 loc) · 4.25 KB
/
tests.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
<!DOCTYPE html>
<html>
<head>
<title>test page</title>
</head>
<script>
function ajaxRequest() {
var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"]; //activeX versions to check for in IE
if (window.ActiveXObject) { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
for (var i = 0; i < activexmodes.length; i++) {
try {
return new ActiveXObject(activexmodes[i]);
}
catch (e) {
//suppress error
}
}
}
else if (window.XMLHttpRequest) // if Mozilla, Safari etc
return new XMLHttpRequest();
else
return false;
}
function ajaxget(delayInMs) {
var mygetrequest = new ajaxRequest();
mygetrequest.onreadystatechange = function () {
if (mygetrequest.readyState == 4) {
if (mygetrequest.status == 200 || window.location.href.indexOf("http") == -1) {
document.getElementById("result").innerHTML = mygetrequest.responseText;
}
else {
alert("An error has occured making the request");
}
}
}
mygetrequest.open("GET", `long/${delayInMs}`, true);
mygetrequest.send(null);
}
</script>
<body>
<h1 id='firstTitle'>Title1</h1>
<div class='text'>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard
dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen
book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially
unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and
more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</div>
<div class='text'>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its
layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to
using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web
page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web
sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose
(injected humour and the like).</div>
<div>
<ul class='list1'>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
</ul>
</div>
<div id='inputs'>
<input type="checkbox" checked="checked" />
<input id="input_text" type="text" value="initial" />
<div class="buttons">
<input id="setvalue" type="button" value="setvalue" onclick="getElementById('result').innerHTML='clicked'">
<input id="visibility" type="button" value="visibility" onmouseover="getElementById('result').style.visibility = 'hidden'"
onmouseout="getElementById('result').style.visibility = 'visible'">
<input id="clearvalue" type="button" value="clearvalue" onclick="getElementById('result').innerHTML=''">
<input id="openTab" type="button" value="openTab" onclick="var win = window.open('http://localhost:8082/tests.html', '_blank');">
<input id="openPopup" type="button" value="openPopup" onclick="var win = window.open('http://localhost:8082/tests.popup.html', 'newwindow', 'width=300, height=250');">
<input id="openConfirm" type="button" value="openConfirm" onclick="if(confirm('are you sure?')) document.getElementById('openConfirm').value= 'confirm_yes'">
<input id="openLongRunningHttpRequest" type="button" value="openLongRunningHttpRequest" onclick="ajaxget(10000)">
</div>
</div>
<div id='result'></div>
<a href="tests.popup.html" id="nextPage">next page</a>
<iframe src="http://localhost:8082/tests.html" width="100%" height="400px;" />
</body>
</html>