-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
61 lines (52 loc) · 937 Bytes
/
index.php
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
<?php
include 'tmpl/tmpl.tpl';
?>
<main class="content">
<strong></strong>
<body>
<div class="container">
<br />
<div class="form-group">
<input type="text" size="133" name="search_text" id="search_text" placeholder="Search " value="">
</div>
</div>
<br />
<div id="result"></div>
</div>
</body>
</html>
<script>
$(document).ready(function(){
load_data();
function load_data(query)
{
$.ajax({
url:"fetch.php",
method:"POST",
data:{query:query},
success:function(data)
{
$('#result').html(data);
}
});
}
$('#search_text').keyup(function(){
var search = $(this).val();
if(search != '')
{
load_data(search);
}
else
{
load_data();
}
});
});
</script>
</main><!-- .content -->
</div><!-- .wrapper -->
<footer class="footer">
<strong></strong>
</footer><!-- .footer -->
</body>
</html>