10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-07-23 19:27:42 +02:00
QUESTDB_website/scripts/data.js
2019-08-22 10:34:07 +02:00

19 lines
391 B
JavaScript

function getDataFromFile(file) {
var result = null;
var xmlhttp = new XMLHttpRequest();
xmlhttp
xmlhttp.open("GET",getFullDataPath(file), false);
xmlhttp.send();
if (xmlhttp.status==200) {
text = xmlhttp.responseText;
}
return JSON.parse(text);
}
function getDoiUrl(data) {
return 'https://doi.org/'+data.doi
}
function getFullDataPath(path) {
return 'data/'+path
}