-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdemo.html
39 lines (29 loc) · 975 Bytes
/
demo.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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="atlas-parser.js"></script>
</head>
<body>
<b>See console output !</b>
<script>
var ajaxRequest = new XMLHttpRequest();
var atlasJSON;
function atlasLoaded() {
if (ajaxRequest.readyState === 4) {
if (ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1) {
var responseText = ajaxRequest.responseText;
atlasJSON = AtlasParser.parse(responseText);
console.log(atlasJSON);
}
}
}
ajaxRequest.onreadystatechange = function () {
atlasLoaded();
};
ajaxRequest.open('GET', './data/demo.atlas', true);
if (ajaxRequest.overrideMimeType) ajaxRequest.overrideMimeType('application/json');
ajaxRequest.send(null);
</script>
</body>
</html>