Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/10/2012, 11:45
charlyta
 
Fecha de Ingreso: junio-2008
Mensajes: 291
Antigüedad: 15 años, 9 meses
Puntos: 9
aprendiendo ventanas modals

Hola. Intento comprender el funcionamiento de las ventanas modales y el paso de datos con acciones a ajax. Probando, he seguido pienso todos los pasos, pero me da errores de widget, etc.. no cargados, a pesar de que los he incluido:

Código:
 <script src="http://code.jquery.com/jquery-latest.js"></script>	
 <link rel="stylesheet" type="text/css" href="ui/smoothness/jquery-ui-1.8.24.custom.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

mi script:
Código Javascript:
Ver original
  1. <script>
  2. $(document).ready(function() {  
  3.  
  4. $("a.ico-resize").click(function() {
  5.    
  6.      $("#dialog").dialog({
  7.                     resizable: false,
  8.                     height:140,
  9.                     width: 400,
  10.                     modal: true,
  11.                     title: 'Do you want to delete ?',
  12.                     buttons: {
  13.                         'Delete ?': function() {
  14.                     var dataString = 'id='+ id ;
  15.  
  16.                             $.ajax({
  17.                             type: "POST",
  18.                             url: "../includes/forms/delete_member.inc.php",
  19.                             data: dataString,
  20.                             cache: false,
  21.  
  22.                             success: function()
  23.                             {
  24.                                 parent.fadeOut('slow', function() {$(this).remove();});
  25.                                 $("#dialog").dialog('close');              
  26.                             }
  27.                     });                                
  28.                         },
  29.                         Cancel: function() {
  30.                            $(this).dialog('close');
  31.                         }
  32.                     }
  33.                 });
  34.                            
  35.             return false;
  36.             });
  37.                            });
  38.    
  39. </script>


mi html


Código:
<div id="dialog"></div>