<!DOCTYPE html> <html> <head> <title><%= musician.name %> - Musician Profile</title>…
- User
<script src="/jquery/dist/jquery.min.js"></script><script>const modal = document.getElementById("edit-profile-modal"); const btn = document.getElementsByTagName("a")[0]; const span = document.getElementsByClassName("close")[0];
btn.onclick = function() { modal.style.display = "block"; } span.onclick = function() { modal.style.display = "none"; } window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } //скрыть плеер, если ссылка не внесена const song1Input = document.getElementById("soundcloud");const song2Input = document.getElementById("soundcloud1"); const player1 = document.getElementsByTagName('iframe')[0]; const player2 = document.getElementsByTagName('iframe')[1]; let songs = { song: "", song1: "" }
function hidePlayer(player) { player.src = ""; player.style.display = "none"; }
function updateSongs() { songs.song = song1Input.value.trim(); songs.song1 = song2Input.value.trim(); }
function updatePlayers() { if (songs.song !== "") { player1.src =
https://w.soundcloud.com/player/?url=${songs.song}&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true; player1.style.display = "block"; } else { hidePlayer(player1); }if (songs.song1 !== "") { player2.src =
https://w.soundcloud.com/player/?url=${songs.song1}&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true; player2.style.display = "block"; } else { hidePlayer(player2); } }song1Input.addEventListener("input", function() { updateSongs(); updatePlayers(); });
song2Input.addEventListener("input", function() { updateSongs(); updatePlayers(); });
updateSongs(); updatePlayers(); //Валидация ссылок с soundcloud function updatePlayers() { if (isValidSoundcloudUrl(songs.song)) { player1.src =
https://w.soundcloud.com/player/?url=${songs.song}&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true; player1.style.display = "block"; } else { hidePlayer(player1); }if (isValidSoundcloudUrl(songs.song1)) { player2.src =
https://w.soundcloud.com/player/?url=${songs.song1}&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true; player2.style.display = "block"; } else { hidePlayer(player2); } }function isValidSoundcloudUrl(url) { const regex = /^https?://(soundcloud.com|snd.sc)/(.*)$/; return regex.test(url); }
$("input[name='city']").autocomplete({ source: '/autocomplete/cities', minLength: 1, - Assistant
The error is saying that the variable "query" is not defined in the file "C:\Users\Ilya\Downloads\my-musician-network\views\profile.ejs" at line 259. It seems that this variable is not being passed to the EJS template from the server-side code. You may need to check the server-side code that is rendering the "profile.ejs" view and make sure that the "query" variable is being passed as a parameter to the template.