Live search
This commit is contained in:
33
website/public/js/search.js
Normal file
33
website/public/js/search.js
Normal file
@@ -0,0 +1,33 @@
|
||||
function searchUsers(n, m) {
|
||||
$.post(
|
||||
"API/searchUsers.php",
|
||||
{
|
||||
n: n,
|
||||
m: m,
|
||||
search: $("#search-input").val(),
|
||||
filter: $("#search-filter").val()
|
||||
}
|
||||
).done(function(data) {
|
||||
console.log(data);
|
||||
if (!showFriends(data, "#search-users-list", 0, "profile.php", "GET")) {
|
||||
$("#search-users-list").text("Niemand gevonden");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function searchGroups(n, m) {
|
||||
$.post(
|
||||
"API/searchGroups.php",
|
||||
{
|
||||
n: n,
|
||||
m: m,
|
||||
search: $("#search-input").val(),
|
||||
filter: $("#search-filter").val()
|
||||
}
|
||||
).done(function(data) {
|
||||
console.log(data);
|
||||
if (!showGroups(data, "#search-groups-list")) {
|
||||
$("#search-groups-list").text("Geen groepen gevonden");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -9,6 +9,8 @@
|
||||
<style>
|
||||
@import url("styles/search.css");
|
||||
</style>
|
||||
|
||||
<script src="js/search.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user