10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2025-01-13 22:36:10 +01:00
QUESTDB_website/scripts/getdoiurl.js

17 lines
406 B
JavaScript
Raw Normal View History

2019-08-21 20:04:29 +02:00
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))
}