-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
34 lines (34 loc) · 1.12 KB
/
index.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
<html>
<head>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>
<title>furigana</title>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("input#button").click(function() {
var postData = $("#text_input").val();
console.log(postData);
$.ajax({
type: "POST",
url: "furigana.rb",
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
data: { val: postData },
dataType: "json",
success: function(data, message) {
console.log(message);
$("#text_output").val(data.text_output);
}
});
});
});
</script>
</head>
<body>
<h1>furigana</h1>
<form action="yomigana.rb" method="post">
<textarea id="text_input" name="text_input" cols="70" rows="10"></textarea>
<p><input type="submit" id="button" onclick="return false;"></p>
</form>
<textarea id="text_output" cols="70" rows="10"></textarea>
</body>
</html>