Skip to content

Instantly share code, notes, and snippets.

@ksider
Last active February 10, 2018 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksider/86b456f6bf833fad3cd7a047f9e77102 to your computer and use it in GitHub Desktop.
Save ksider/86b456f6bf833fad3cd7a047f9e77102 to your computer and use it in GitHub Desktop.
Jquery DOI checker
function doi(doi) {
url = "https://doi.org/api/handles/" + doi;
r = '';
$.ajax({
url: url,
async:false,
dataType: "json",
success: function(data) {
if (data.responseCode) {
r = data.responseCode;
} else {
r = 'без кода';
}
},
statusCode: {
404: function() {
r = 'несуществует';
}
}
});
return r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment