10 lines
393 B
JavaScript
10 lines
393 B
JavaScript
|
function updateMonstersDropdown() {
|
||
|
const selectedFamily = familyDropdown.value;
|
||
|
|
||
|
// Fetch monsters data from the server based on the selected family
|
||
|
fetch(`/get_monsters?family=${selectedFamily}`)
|
||
|
.then(response => response.json())
|
||
|
.then(data => populateDropdown(monsterDropdown, data))
|
||
|
.catch(error => console.error("Error fetching monsters:", error));
|
||
|
}
|