0
$(document).ready(function() {
    $.ajax({
        url: 'php/sql/getPlaylists.php',
        type: 'GET',
        success: function(result) {
            let data = $.parseJSON(result);

            let contenido = "";

            $.each(data, function(index, value) {
                contenido += "<div class='col-3 my-3 overflow-hidden'> ";
                contenido +=
                    "<div class='card shadow-40 m-4' style='width: 350px !important; '>";

                contenido += "<img class='card-img-top' src='uploads/fotos/" + value.foto +
                    "' alt='Card Image' height='250px'> ";
                contenido += "<div class='card-body'> ";

                contenido += "<h6 class='card-title'>";
                contenido += value.nombre;
                contenido += "</h6>";
                contenido += "<a directorio='php/routes/verplaylist.php?id=" + value.id +
                    "' class='routing btn btn-primary'>Ver</a>";

                contenido += "</div>";
                contenido += "</div>";
                contenido += "</div>";
            });
            $('#lista-datos').append(contenido);
            

        },

    });
});

I'm trying to add click function when click these a elements but it doesn't detect them, I tried before with an not apended item and it worked, but it's not the same with these ones.

isherwood
  • 52,576
  • 15
  • 105
  • 143

0 Answers0