-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
53 lines (47 loc) · 1.02 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
<!doctype html>
<head>
<meta charset="utf-8">
<title>Browser test for another-dimension</title>
<style>
body {
font-family: monospace;
white-space: pre;
}
.error {
font-weight: bold;
color: #990000;
}
</style>
</head>
<body>
<script>
function printError(message) {
document.write('<div class="error">Error: ' + message + '</div>');
}
</script>
<script src="another-dimension.js"></script>
<script>
try {
document.write("Testing another-dimension named import...\n");
let dim1 = Dimension("1in");
if (dim1.toNumber("mm") != 25.4) throw new Error("Incorrect conversion\n");
document.write("All OK.");
}
catch (error) {
printError(error);
}
</script>
<script src="another-dimension.js" data-another-dimension-global="XDimension"></script>
<script>
try {
document.write("Testing another-dimension named import...\n");
let dim1 = XDimension("1in");
if (dim1.toNumber("mm") != 25.4) throw new Error("Incorrect conversion\n");
document.write("All OK.");
}
catch (error) {
printError(error);
}
</script>
</body>
</html>