Skip to content

Commit

Permalink
Possible issue with images?
Browse files Browse the repository at this point in the history
  • Loading branch information
AACooper1 committed Mar 19, 2024
1 parent aa5cad6 commit 81580de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/people.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ function createPeopleCards(people)

// Add image
name_split = person.name.split(" ")
let image_path = "web/images/people/" + name_split[0] + name_split[1][0] + ".jpg";
let image_path = "images/people/" + name_split[0] + name_split[1][0] + ".jpg";
const person_image = document.createElement("img")
person_image.setAttribute("class", "card-img-top")
person_image.setAttribute("src", image_path)

person_card.prepend(person_image)

person_image.onerror = () => {
person_image.setAttribute("src", "web/images/people/placeholder.jpg");
person_image.setAttribute("src", "images/people/placeholder.jpg");
};

// Append to category
Expand Down

0 comments on commit 81580de

Please sign in to comment.