forked from macc704/isfw2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1-3.html
43 lines (34 loc) · 1.13 KB
/
1-3.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="settings.js"></script>
<script type="text/javascript" src="osql.js"></script>
<script>
function button1Pressed() {
execSelect();
}
async function execSelect() {
var userid = document.getElementById('tf1').value;
var tweet = document.getElementById('tf2').value;
var sql = 'insert into Tweets (name, tweet, time) values("%USERID%", "%TWEET%", now());';
sql = sql.replace("%USERID%", userid);
sql = sql.replace("%TWEET%", tweet);
console.log(sql);
var objects = await osql.connect(sql);
console.log(objects);
}
</script>
</head>
<body>
<h1>Tweets</h1>
<br>
ログイン名:<input id="tf1" value="名無し" type="textfield">
<br>
tweet:<input id="tf2" type="textfield">
<button onclick="button1Pressed()">tweet</button>
<br>
<p id="result"></p>
</body>
</html>