- Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathexample.html
More file actions
Latest commit
44 lines (31 loc) · 927 Bytes
/
Copy pathexample.html
File metadata and controls
44 lines (31 loc) · 927 Bytes
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>
<styletype="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>
<scriptsrc="./lib/_languageData.js" charset="utf-8"></script>
<scriptsrc="./lib/guessLanguage.js" charset="utf-8"></script>
<p>Enter some text below to try this library:</p>
<textareaid="input">Type some text here!</textarea>
<divid="output"></div>
<scriptcharset="utf-8">
varinputEl=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>