-
Notifications
You must be signed in to change notification settings - Fork 4
/
login.html~
80 lines (44 loc) · 1.65 KB
/
login.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<html>
<body background="background.jpg">
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
<form method="post">
<input type="text" id="username" placeholder="Username"> </br>
<input type="password" name="password" id="password" placeholder="Password">
</form>
<button type="button" id="submit" onclick="getText()"> Submit</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min.js"></script>
<script type="text/javascript">
function getText() {
username = document.getElementById("username").value;
password = document.getElementById("password").value;
if ((username=="") || (password=="")) {
if (username == "") {
$("#username").effect("bounce");
}
if (password == "") {
$("#password").effect("bounce");
}
username = document.getElementById("username").value;
password = document.getElementById("password").value;
}
else {
$.ajax({
url: "http://127.0.0.1:5000/r",
type: "POST",
data: "username=".concat(username) + "&password=".concat(password),
success: function (data) {
$.getJSON(data, function(json){
});
}
});
}
}
</script>
</div>
</body>
</html>