-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
43 lines (32 loc) · 1012 Bytes
/
search.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
<?php
require_once("./includeClasses.php");
$metaInfo = MetaProvider::getMetaInfo($con, 15, null); //index page
$title = $metaInfo["title"];
$metaDescription = $metaInfo["description"];
$metaKeywords = $metaInfo["keywords"];
require_once("./includes/header.php");
?>
<div class="textboxContainer">
<input type="text" class="searchInput" placeholder="Search for something">
</div>
<div class="results">
</div>
<script>
$(function() {
var timer;
$(".searchInput").keyup(function() {
clearTimeout(timer);
timer = setTimeout(function() {
var val = $(".searchInput").val();
if(val !== "") {
$.post("ajax/getSearchResults.php", { term: val }, function(data) {
$(".results").html(data);
})
}
else {
$(".results").html = "";
}
}, 500);
})
})
</script>