Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/08/2013, 21:40
cesa_r
 
Fecha de Ingreso: julio-2013
Mensajes: 158
Antigüedad: 10 años, 9 meses
Puntos: 6
Respuesta: repetir div dinamicamente

Ya lo e solucionado que tonto al final quedo asi:

Cita:
$(document).on('click', '.delete', function() { //ESTA LINEA OJO POR SI ALGUIEN TIENE EL MISMO PROBLEMA PRIEMERO EL EVENTO ('click'), LUEGO EL ELEMENTO(#ELEMENTO) Y AL FINAL FUNCTION (function())

//Recogemos la id del contenedor padre
var parent = $(this).parent().attr('id');
//Recogemos el valor del servicio
var service = $(this).parent().attr('data');

var dataString = 'id='+service;

alertify.confirm("<p>¡Realmente deseas eliminar esto?<br><br><b>ENTER</b> y <b>ESC</b> corresponden a <b>Aceptar</b> o <b>Cancelar</b></p>", function (e) {
if (e) {

$.ajax({
type: "POST",
url: "Topic/modules/php/deletePublication.php",
data: dataString,
success: function() {
$('#'+parent).fadeOut(1000);
alertify.log("¡Se ha eliminado con éxito!");
}
});


} else { alertify.error("¡Has cancelado eliminar el contenido!");
}
});


});
SALUDOS