-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjavascript.html
More file actions
29 lines (26 loc) · 1.03 KB
/
javascript.html
File metadata and controls
29 lines (26 loc) · 1.03 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
<html>
<body>
<pre id="console"></pre>
<script src="//hapi-server.github.io/client-javascript/0.0.1/moment-2.29.3.min.js"></script>
<script src="//hapi-server.github.io/client-javascript/0.0.1/hapi-0.0.1.js"></script>
<script>
server = SERVER;
dataset = DATASET;
// Use parameters='' to request all data. Multiple parameters
// can be requested using a comma-separated list, e.g., parameters='X_TOD,Y_TOD'
parameters = PARAMETERS;
start = START;
stop = STOP;
function cb(data, meta) {
let c = document.getElementById('console');
c.insertAdjacentText('beforeend','\ndata = ' + JSON.stringify(data, null, 4));
c.insertAdjacentText('beforeend','\n\nmeta = ' + JSON.stringify(meta, null, 4));
console.log(data);
console.log(meta);
}
// All options set to their default values
opts = {'renameTime': true, 'raw': false, 'jsTimeNumber': false, 'jsDateObject': false};
hapi(server, dataset, parameters, start, stop, cb, opts);
</script>
</body>
</html>