Ver Mensaje Individual
  #6 (permalink)  
Antiguo 03/02/2009, 10:13
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Problema con AJAX

Prueba así:
Código javascript:
Ver original
  1. function nuevoAjax(){
  2. var xmlhttp;
  3. try {
  4.       xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  5. } catch (e) {
  6.       try {
  7.             xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  8.      } catch (E) {
  9.             xmlhttp = false;
  10.      }
  11. }
  12. if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  13.          xmlhttp = new XMLHttpRequest();
  14. }
  15.  
  16. return xmlhttp;
  17. }
  18.  
  19. function cargarContenido(pagina,destino) {
  20.       var contenedor;
  21.       var ajax;
  22.  
  23.       contenedor = document.getElementById(destino);
  24.       ajax = nuevoAjax();
  25.       ajax.open("GET", pagina, true);
  26.       ajax.onreadystatechange=function() {
  27.             if (ajax.readyState==4) {
  28.                   contenedor.innerHTML = ajax.responseText;
  29.            }
  30.       }
  31.       ajax.send(null);
  32. }

Saludos