Foros del Web » Programando para Internet » Javascript » Frameworks JS »

Ayuda con html en div

Estas en el tema de Ayuda con html en div en el foro de Frameworks JS en Foros del Web. Hola Amigos espero que puedan ayudarme , tengo mas de 5 dias buscando la solucion.... estoy haciendo mi pagina web y quiero cargar un contenido ...
  #1 (permalink)  
Antiguo 04/04/2010, 23:44
 
Fecha de Ingreso: marzo-2009
Mensajes: 32
Antigüedad: 15 años
Puntos: 0
Ayuda con html en div

Hola Amigos espero que puedan ayudarme , tengo mas de 5 dias buscando la solucion....

estoy haciendo mi pagina web y quiero cargar un contenido en un div



Código HTML:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Primer ejemplo AJAX Prototype</title>
</head>

<script type="text/javascript">

function nuevoAjax(xmlhttp){

   try {
       xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } 
   catch (e) {
       try {
         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } 
      catch (E) {
          xmlhttp = false;
      }
   }
   if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
      xmlhttp = new XMLHttpRequest();
   }
   return xmlhttp
}

function cargarContenido(pagina,destino){
   var contenedor;
   var ajax;
   
   contenedor = document.getElementById(destino);
   ajax = nuevoAjax(ajax);
   ajax.open("GET", pagina, true);
   ajax.onreadystatechange=function() {
      if (ajax.readyState==4) {
         contenedor.innerHTML = ajax.responseText;
      }
   }
   ajax.send(null);
}



</script>
</head>
<body >
<a href="#" onclick="cargarContenido('noticias.html', 'contenedor')">Cargar contenido</a>
<a href="#" onclick="cargarContenido('galeria/index.php', 'contenedor')">Galeria</a>
<a href="galeria/index.php">Galeria REAL</a>

<div id="contenedor">
aqui aparecera el contenido
</div>

</body>



pero no me carga los scripts de todo... no se que hacer la verdad... si seleccionan galeria correcta podran ver como debe mostrar la galeria...

espero puedan ayudarme

muchas gracias


PARA VER FUNCIONANDO AQUI

www.ucam.com.mx/prueba/prueba8.html
  #2 (permalink)  
Antiguo 05/04/2010, 06:32
 
Fecha de Ingreso: marzo-2009
Mensajes: 30
Antigüedad: 15 años, 1 mes
Puntos: 2
Respuesta: Ayuda con html en div

porque no intentas usar jquery te iria muy bien!

Etiquetas: ajax, html
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:49.