10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-07-23 11:17:42 +02:00
QUESTDB_website/scripts/data.js

22 lines
551 B
JavaScript
Raw Normal View History

function getDataFromFile(file,fn) {
2019-08-22 10:34:07 +02:00
var result = null;
var xmlhttp = new XMLHttpRequest();
xmlhttp
xmlhttp.open("GET",getFullDataPath(file), true);
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {//when a good response is given do this
var data = JSON.parse(this.responseText); // convert the response to a json object
fn(data)
}
2019-08-22 10:34:07 +02:00
}
xmlhttp.send();
2019-08-22 10:34:07 +02:00
}
2019-08-22 15:23:52 +02:00
function getDoiUrl(doi) {
return 'https://doi.org/'+doi
2019-08-22 10:34:07 +02:00
}
function getFullDataPath(path) {
return 'data/'+path
}