I’m trying to pull data from our ‘faceclaim’ subcategory to show a list of faceclaims that are already in use on our site. However, when it pulls from the field, it’s also showing all the applications that don’t use faceclaims and leave the space blank. This results in a scrollbar that is 75% blank space from all the blank fields being populated, with the list of faceclaims below in alphabetical order. I’m trying to remove all that blank space so it only shows things that are A-Z.
function getCharacters() {$.get("/index.php?act=Members&max_results=1000&sort_key=joined&sort_order=asc",function (data) {var doc = new DOMParser().parseFromString(data, "text/html");
var faces= $(
".grabbyhands:not(.g_3):not(.g_4):not(.g_5):not(.g_10)",
doc
);
var sortedFaces = [];
faces.each(function () {
let $this = $(this);
let $charprofile = $this.find(".whodafuk");
sortedFaces.push([$charprofile.text(), $charprofile]);
});
sortedFaces.sort(function (a, b) {
return a[0].localeCompare(b[0]);
});
sortedFaces.forEach(function (face) {
$("#faceclaimgods").append(face[1]);
});
$("#scanning").on("input", function () {
var searchValue = $(this).val().toLowerCase();
sortedFaces.forEach(function (face) {
var $charprofile = face[1];
var faceclaim = face[0].toLowerCase();
if (faceclaim.includes(searchValue)) {
$charprofile.show();
} else {
$charprofile.hide();
}
});
});
}); }
getCharacters();
I’m a hobbyist coder and kind of piecemeal things together from around the internet. I’ve taken a few courses in college and online self-taught courses, but am still trying my best to learn!
Experimental Error is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.