Ver Mensaje Individual
  #6 (permalink)  
Antiguo 28/09/2012, 12:34
charlyta
 
Fecha de Ingreso: junio-2008
Mensajes: 291
Antigüedad: 15 años, 10 meses
Puntos: 9
Respuesta: funcion eliminar imagen

Solucionado!! Pero no creo que pasando los parámetros así sea muy útil, debe haber otra manera


Código Javascript:
Ver original
  1. <script>
  2.   $(document).ready(function() {
  3. $("a.ico-edit").live("click",function(event){
  4.                                       var fname=$(this).attr("id");var directory=$(this).attr("rel");var deletecount=$(this).attr("value");
  5.    event.stopPropagation();
  6.    if(confirm("Do you want to delete?")) {
  7.     this.click;
  8.        alert("Ok");
  9.         $.ajax({ url: "delete_img.php",
  10.         data: {"file":fname,"directory":directory},
  11.         type: 'post',
  12.         success: function(output) {
  13.           alert(output);
  14.          
  15. $('#' + deletecount).remove();
  16.  
  17.  
  18.  
  19.                  }
  20.     });
  21.    }
  22.    else
  23.    {
  24.        alert("Cancel");
  25.    }      
  26.    event.preventDefault();
  27.    
  28. });
  29.                              });
  30.  
  31. </script>