forked from swagger-api/swagger-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
30 lines (28 loc) · 1 KB
/
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="https://raw.github.com/wordnik/swagger.js/blob/master/lib/swagger.js"></script>
<script type="text/javascript">
$(function() {
wordnik = new Api({
api_key: 'a2a73e7b926c924fad7001ca3111acd55af2ffabf50eb4ae5', // sample wordnik API key
verbose: true,
success: function() {
args = {word: 'sanctimonious'}
wordnik.word.getDefinitions.do(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>