-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpredict.html
More file actions
42 lines (38 loc) · 1.27 KB
/
predict.html
File metadata and controls
42 lines (38 loc) · 1.27 KB
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
<!DOCTYPE html>
<html>
<head>
<title>FRC Prediction</title>
<link rel="icon" href="img/favicon.ico" type="image/x-icon">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
<h1>Frc Prediction</h1><br>
<form>
Red 1: <input maxlength="4" id="r1" type="text">
Red 2: <input maxlength="4" id="r2" type="text">
Red 3: <input maxlength="4" id="r3" type="text">
<br>
<br>
Blue 1: <input maxlength="4" id="b1" type="text">
Blue 2: <input maxlength="4" id="b2" type="text">
Blue 3: <input maxlength="4" id="b3" type="text">
<br><br>
<button id="submit" type="button">Submit</button>
</form>
<p id="result"></p>
</body>
<script>
$(function(){
$("#submit").click(function(){
$.ajax({
type: "GET",
url: "/api/predict/" + $("#r1").val() + "," + $("#r2").val() + "," + $("#r3").val() + "/"
+ $("#b1").val() + "," + $("#b2").val() + "," + $("#b3").val(),
dataType: "text",
success: function(result){
$("#result").empty().append((result * 100) + '%')
}
})})
})
</script>
</html>