-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdemo.html
37 lines (34 loc) · 1.01 KB
/
demo.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
<html>
<head>
<title>Compact Language Detection</title>
<style>
html, body {
font-family: "Helvetica Neue", "Helvetica", sans-sarif;
margin: 5%;
}
textarea {
font-size: 14px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="cld-min.js"></script>
<script type="text/javascript">
$("document").ready(function() {
$text = $("textarea");
$output = $(".output");
$text.bind('keypress change',function(e) {
setTimeout(function() {
$output.text(detectLanguage($text.val()));
},1);
});
});
</script>
<body>
<h3>Compact Language Detector Demo</h3>
<p>Enter some text:</p>
<textarea rows="8" cols="40"></textarea>
<p>
Language: <span class="output"></span>
</p>
</body>
</html>