С другой стороны, у меня нет проблем с data-id= 4
Код: Выделить всё
$('#tablesForm').on('dblclick', 'tr', function(event) {
var idCard = $(this).attr("data-id");
var mouseX = event.pageX;
var mouseY = event.pageY;
$('#results').remove();
// Afficher idCard en utilisant AJAX
$.ajax({
url: 'data/show_card.php?mode=client',
type: 'get', // ou 'POST' selon votre configuration
data: {
id: idCard
},
success: function(response) {
var resultElement = $('');
resultElement.html(response)
.css({
"position": "absolute",
"left": mouseX + "px",
"top": mouseY + "px"
})
.appendTo('body');
}
});
event.preventDefault();
event.stopPropagation();
});
$(document).on("click", function(event) {
if (!$(event.target).closest('#results').length) {
$('#results').remove();
}
});Код: Выделить всё
rouge>
orange
Подробнее здесь: https://stackoverflow.com/questions/786 ... xt-in-ajax