mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2025-01-13 22:36:10 +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))
|
||
|
}
|