-
Notifications
You must be signed in to change notification settings - Fork 39
/
example.html
44 lines (31 loc) · 927 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<title>guessLanguage.js library demo</title>
<style type="text/css">
body {
font-family: Tahoma, sans-serif;
}
textarea#input {
width: 600px;
height: 120px;
border: 3px solid #cccccc;
padding: 5px;
}
div#output {
color: #CC0000;
}
</style>
<h1>guessLanguage.js library demo</h1>
<script src="./lib/_languageData.js" charset="utf-8"></script>
<script src="./lib/guessLanguage.js" charset="utf-8"></script>
<p>Enter some text below to try this library:</p>
<textarea id="input">Type some text here!</textarea>
<div id="output"></div>
<script charset="utf-8">
var inputEl = document.getElementById('input'),
outputEl = document.getElementById('output');
inputEl.addEventListener('keyup', function() {
guessLanguage.info(this.value, function(info) {
outputEl.textContent = 'Detected Language: ' + info[2] + " [" + info[0] + "]";
});
}, false);
</script>