-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTacSim.html
More file actions
62 lines (57 loc) · 2.15 KB
/
TacSim.html
File metadata and controls
62 lines (57 loc) · 2.15 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html>
<head>
<title>TacSim - Try it out!</title>
<script src="http://code.jquery.com/jquery-3.3.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
var url = "http://api.is3tool.com:9000/tacsim";
// var files;
$(document).ready(function() {
$("#fileForm").submit(function(event){
event.preventDefault();
$("#step1").slideUp();
var files = $("#file").prop("files");
// var formData = $(this).serialize();
var data = new FormData();
data.append("file", files[0]);
$.ajax(url, {
method: "post",
processData: false,
contentType: false,
type: "multipart/form-data",
data: data
})
.done(function(response) {
$("#step2").slideDown();
$("#data").html(JSON.stringify(response));
});
});
});
</script>
</head>
<body>
<h1>TacSim+</h1>
<hr />
<br />
<div id="step1">
<h2>Step 1 - Get some data:</h2>
<br />
<form method="POST" enctype="multipart/form-data" id="fileForm">
<label>OPTIONAL - Custom Data:</label>
<input type="file" name="file" id="file">
<br /><br />
<input type="submit" value="Run with TascSim Simulator">
</form>
<br />
<!-- <a href="javascript:void(0);" id="getData">Run TacSim with sample data!</a> -->
<br />
<hr />
<br />
</div>
<div id="step2" style="display:none;">
<h3>Step 2 - Your data will appear here: </h3>
<br />
<div id="data"></div>
</div>
</body>
</html>