nehalelkaref commited on
Commit
bf61373
ยท
1 Parent(s): b730065

Update templates/home.html

Browse files
Files changed (1) hide show
  1. templates/home.html +21 -3
templates/home.html CHANGED
@@ -15,10 +15,28 @@
15
  <form action="{{url_for('classify')}}" method="POST">
16
  <textarea name="comment" required="true" rows="1" cols="40"></textarea>
17
  <br>
18
- <input type="submit" value="ุตูŽู†ูู" class="button-89">
19
  <br>
20
-
21
- {% extends 'prediction.html' %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  </form>
24
  </div>
 
15
  <form action="{{url_for('classify')}}" method="POST">
16
  <textarea name="comment" required="true" rows="1" cols="40"></textarea>
17
  <br>
18
+ <input id="text" type="submit" value="ุตูŽู†ูู" class="button-89">
19
  <br>
20
+ <div name = "output" id="output" style="visibility: hidden;">
21
+ <p class="output-statement">{{output}}</p>
22
+ </div>
23
+ <script>
24
+ var text = document.getElementById("text").value
25
+ document.getElementById("output").style="visibility: visible";
26
+ $('form').on('submit', function(event) {
27
+ $.ajax({
28
+ type: 'POST',
29
+ url: "{{ url_for( '/classify' ) }}",
30
+ data: JSON.stringify({'input':text}),
31
+ contentType: "application/json",
32
+ success:function(response){
33
+ success: function(response) {
34
+ document.write(response);
35
+ document.getElementById("output").style="visibility: visible";
36
+ },
37
+ }
38
+ })
39
+ </script>
40
 
41
  </form>
42
  </div>