|
a |
|
b/templates/gene.html |
|
|
1 |
{% extends 'layout.html' %} |
|
|
2 |
|
|
|
3 |
{% block script %} |
|
|
4 |
<script> |
|
|
5 |
$(document).ready(function(){ |
|
|
6 |
load_data(); |
|
|
7 |
function load_data(query) |
|
|
8 |
{ |
|
|
9 |
$.ajax({ |
|
|
10 |
url:"/search", |
|
|
11 |
method:"POST", |
|
|
12 |
data:{query:query}, |
|
|
13 |
success:function(data) |
|
|
14 |
{ |
|
|
15 |
$('#result').html(data); |
|
|
16 |
$("#result").append(data.htmlresponse); |
|
|
17 |
} |
|
|
18 |
}); |
|
|
19 |
} |
|
|
20 |
$('#text').keypress(function(e){ |
|
|
21 |
var key = e.which; |
|
|
22 |
if(key == 13){ |
|
|
23 |
var search = $(this).val(); |
|
|
24 |
if(search != ''){ |
|
|
25 |
load_data(search); |
|
|
26 |
}else{ |
|
|
27 |
load_data(); |
|
|
28 |
} |
|
|
29 |
} |
|
|
30 |
}); |
|
|
31 |
}); |
|
|
32 |
</script> |
|
|
33 |
{% endblock %} |
|
|
34 |
|
|
|
35 |
{% block content %} |
|
|
36 |
<h1 class="text-center">Gene Tool</h1> |
|
|
37 |
<div class="container text-center"> |
|
|
38 |
<div class="container-fluid"> |
|
|
39 |
<div class="d-flex"> |
|
|
40 |
<input class="form-control me-2" type="search" name="text" id="text" placeholder="Enter Gene Symbol here to search for details of the Genes matching and Press 'ENTER'" aria-label="Search"> |
|
|
41 |
</div> |
|
|
42 |
</div> |
|
|
43 |
</div> |
|
|
44 |
<div class="container text-center" style="margin-top: 5%;" id="result" name="result"></div> |
|
|
45 |
{% endblock %} |