$(document).ready(() => { let selectedAuthors = new Map(); let selectedGenres = new Map(); let currentPage = 1; let pageSize = 20; let totalBooks = 0; const urlParams = new URLSearchParams(window.location.search); const genreIdsFromUrl = urlParams.getAll("genre_id"); const authorIdsFromUrl = urlParams.getAll("author_id"); const searchFromUrl = urlParams.get("q"); Promise.all([ fetch("/api/authors").then((response) => response.json()), fetch("/api/genres").then((response) => response.json()), ]) .then(([authorsData, genresData]) => { const $dropdown = $("#author-dropdown"); authorsData.authors.forEach((author) => { $("
Попробуйте изменить параметры поиска или фильтры
Авторы: ${escapeHtml(authorsText)}
${escapeHtml(book.description || "Описание отсутствует")}
Не удалось загрузить список книг