mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-12-25 22:03:49 +01:00
17 lines
406 B
JavaScript
17 lines
406 B
JavaScript
function getjsonfromfile(path) {
|
|
var result = null;
|
|
var xmlhttp = new XMLHttpRequest();
|
|
xmlhttp
|
|
xmlhttp.open("GET", path, false);
|
|
xmlhttp.send();
|
|
if (xmlhttp.status==200) {
|
|
text = xmlhttp.responseText;
|
|
}
|
|
return JSON.parse(text);
|
|
}
|
|
function getdoiurl(datas) {
|
|
return 'https://doi.org/'+datas.doi
|
|
}
|
|
function getdoiurlfromfile(file) {
|
|
return getdoiurl(getjsonfromfile('datas/'+file))
|
|
} |