-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload_data.js
More file actions
66 lines (49 loc) · 1.47 KB
/
load_data.js
File metadata and controls
66 lines (49 loc) · 1.47 KB
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
const request_pct = new XMLHttpRequest();
request_pct.open('GET', 'pct_coefs.json', true);
var pct_coefs = {}
var pct_int = {}
request_pct.onload = function() {
if (request_pct.status === 200) {
pct_coefs = JSON.parse(request_pct.responseText);
pct_int = pct_coefs['int']['']
} else {
console.log('fail');
// Reached the server, but it returned an error
}
}
request_pct.onerror = function() {
console.error('An error occurred fetching the JSON for pct coefs');
};
request_pct.send();
const request_loc = new XMLHttpRequest();
request_loc.open('GET', 'loc_coefs.json', true);
var loc_coefs = {}
var loc_int = {}
request_loc.onload = function() {
if (request_loc.status === 200) {
loc_coefs = JSON.parse(request_loc.responseText);
loc_int = loc_coefs['int']['']
} else {
console.log('fail');
// Reached the server, but it returned an error
}
}
request_loc.onerror = function() {
console.error('An error occurred fetching the JSON for loc coefs');
};
request_loc.send();
const request_pos = new XMLHttpRequest();
request_pos.open('GET', 'player_pos_dict.json', true);
var pos_map = {}
request_pos.onload = function() {
if (request_pos.status === 200) {
pos_map = JSON.parse(request_pos.responseText);
} else {
console.log('fail');
// Reached the server, but it returned an error
}
}
request_pos.onerror = function() {
console.error('An error occurred fetching the JSON for position data');
};
request_pos.send();