forked from swagger-api/swagger-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
30 lines (28 loc) · 944 Bytes
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html>
<head>
<title>swagger.js example</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="./lib/swagger.js"></script>
<script type="text/javascript">
$(function() {
wordnik = new SwaggerApi({
api_key: 'YOUR_API_KEY', // sample wordnik API key
verbose: true,
success: function() {
args = {word: 'sanctimonious'}
wordnik.word.getDefinitions(args, function(definitions){
console.log(definitions[0].word);
for (var i = 0; i < definitions.length; i++) {
var definition = definitions[i];
console.log(definition.partOfSpeech + ": " + definition.text);
}
});
}
});
});
</script>
</head>
<body>
</body>
</html>