<!DOCTYPE html> <html> <head> <title><%= musician.name %> - Musician Profile</title>…
- User
<% if (userLoggedIn && username === musician.name) { %> <a href="/profile/<%= musician.id %>/edit">Edit profile</a> <div id="edit-profile-modal" class="modal"> <div class="modal-content"> <span class="close">×</span> <h2>Edit Profile</h2> <form action="/profile/<%= musician.id %>/edit" method="POST" enctype="multipart/form-data"> <div> <label for="name">Name:</label> <input type="text" id="name" name="name" value="<%= musician.name %>"> </div> <div> <label for="genre">Genre:</label> <input type="text" id="genre" name="genre" value="<%= musician.genre %>"> </div> <div> <label for="instrument">Instrument:</label> <input type="text" id="instrument" name="instrument" value="<%= musician.instrument %>"> </div> <div> <label for="location">Location:</label> <input type="text" id="location" name="location" value="<%= musician.location %>"> </div> <div> <label for="bio">Bio:</label> <textarea id="bio" name="bio"><%= musician.bio %></textarea> </div> <div>SoundCloud:
<div> <label for="thumbnail">Thumbnail:</label> <input type="file" id="thumbnail" name="thumbnail"> </div> <button type="submit">Save</button> </form> </div> </div><% } %> 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 musicFields = document.getElementById("music-fields");const addMusicButton = document.querySelector(".add-music-button");
addMusicButton.addEventListener("click", (event) => { event.preventDefault(); const musicField = document.createElement("div"); musicField.innerHTML = ' ×'; musicFields.insertBefore(musicField, addMusicButton.parentNode); });
musicFields.addEventListener("click", (event) => { if (event.target.classList.contains(“delete-music-button”)) { event.preventDefault(); event.target.parentNode.remove(); } });
ошибка:
SyntaxError: Unexpected token 'catch' in C:\Users\Ilya\Downloads\my-musician-network\views\profile.ejs while compiling ejs
- Assistant
It seems like there is no "catch" statement in the given code, so it's possible that the error is somewhere else in the file. Can you please provide more context or code for me to better understand where the error might be occurring?