Last active
February 10, 2018 21:05
-
-
Save ksider/86b456f6bf833fad3cd7a047f9e77102 to your computer and use it in GitHub Desktop.
Jquery DOI checker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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