Ver Mensaje Individual
  #5 (permalink)  
Antiguo 16/10/2014, 16:52
robinson37
 
Fecha de Ingreso: marzo-2009
Mensajes: 44
Antigüedad: 15 años, 1 mes
Puntos: 1
Respuesta: Eliminar y recargar pagina

hola lo pongo y sigue Igual

Código Javascript:
Ver original
  1. <script>
  2. function nuevoAjax(){
  3.     var xmlhttp=false;
  4.     try {
  5.         xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  6.     } catch (e) {
  7.         try {
  8.             xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  9.         } catch (E) {
  10.             xmlhttp = false;
  11.         }
  12.     }
  13.  
  14.     if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  15.         xmlhttp = new XMLHttpRequest();
  16.     }
  17.     return xmlhttp;
  18. }
  19. //---------------------------------------------------
  20. </script>
  21. <script>
  22.  
  23. function eliminar(Id){
  24.    
  25.     if (confirm("Esta seguro que desea Eliminar Evaluacion")){
  26.     var contenedor;
  27.     contenedor = document.getElementById('contenedor');
  28.    
  29.    
  30.        
  31.     ajax=nuevoAjax();
  32.     ajax.open("GET", "../LogicaPresentacion/LogicaElimieval.php?Id_Resu="+Id,true);
  33.     ajax.onreadystatechange=function() {
  34.         if (ajax.readyState==4) {
  35.             contenedor.style.display = "none"
  36.            
  37.         }
  38.     }
  39.    
  40.      ajax.send(null)
  41.    }
  42.  }
  43.  
  44. </script>

Código HTML:
Ver original
  1. <td valign="top" align="left" width="45">
  2. <a href="javascript:void(0)" title="Eliminar" onClick="eliminar('<?php echo $reg["Id_Resu"];?>')"><img src="http://www.forosdelweb.com/f13/Presentacion/image/eliminar.png" width="38" height="31" border="0"></a>
  3. </td>


logicaeliminaeval.php

Código PHP:
Ver original
  1. <?php
  2. include ('../LogicaPresentacion/connect.php');
  3. $sql="delete from Resultado
  4. where
  5. Id_Resu=".$_GET["Id_Resu"]."";
  6. $res=mysql_query($sql,$con);
  7. echo "<script type=''>
  8.     alert('Los datos del empleado fueron eliminados correctamente');
  9.     window.location='index.php';
  10. </script>";
  11. ?>

no me da si borra pero no se refresca la pagina toca con f5