in movies.mjs,
showMovieDetails() is not defined so we get a
Uncaught ReferenceError: showMovieDetails is not defined
onclick http://localhost:3000/:1
so this would mean not only is it not defined anywhere, it's not available in the global scope when the user clicked on the Details button available from the movies.mjs file.
Do we,
function showMovieDetails(movieId) {
console.log("Movie ID:", movieId);
// your logic here
}
window.showMovieDetails = function(id) {
// accessible from inline onclick now
};
or something like
document.querySelectorAll('.btn-outline-primary').forEach(btn => {
btn.addEventListener('click', function() {
const movieId = this.getAttribute('data-movie-id');
showMovieDetails(movieId);
});
});
in movies.mjs,
showMovieDetails() is not defined so we get a
so this would mean not only is it not defined anywhere, it's not available in the global scope when the user clicked on the Details button available from the movies.mjs file.
Do we,
or something like