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

no me carga en los divs

Estas en el tema de no me carga en los divs en el foro de Frameworks JS en Foros del Web. buenas, estoy empezando a diseñar una pagina y la quiero hacer con divs. para ello me he creado una funcion en AJAX. La funcion la ...
  #1 (permalink)  
Antiguo 30/12/2009, 02:04
 
Fecha de Ingreso: noviembre-2009
Mensajes: 209
Antigüedad: 14 años, 6 meses
Puntos: 0
no me carga en los divs

buenas, estoy empezando a diseñar una pagina y la quiero hacer con divs.
para ello me he creado una funcion en AJAX. La funcion la tengo dentro de la carpeta js.
es el siguiente codigo:
function MostrarConsulta(datos,src){
divResultado = document.getElementById(src);
ajax=objetoAjax();
ajax.open("GET", datos);
ajax.onreadystatechange=function() {
if (ajax.readyState==4) {
divResultado.innerHTML = ajax.responseText
}
}
ajax.send(null)
}
Luego he creado dos paginas, index e indices, y quiero que al pinchar enun link de index se me cargue el contenido de indices en un div que hay en index, pero no me funciona. os paso el codigo por si me podeis ayudar.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/javascript" src="../../js/ajax.js"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body background="../../imagenes/fondo.jpg">
<div id="titulo" style="position:absolute; left:0px; top:0px; width:1024px; height:73px; z-index:1"><img src="../../imagenes/Barra.jpg" width="1024" height="99"></div>
<div id="Layer1" style="position:absolute; left:297px; top:14px; width:147px; height:28px; z-index:1">
<a href="javascript:MostrarConsulta('indices.html','i ndice');" target="_self">LOS
CELT&Iacute;BEROS</a></div>
<div id="Layer2" style="position:absolute; left:476px; top:14px; width:206px; height:28px; z-index:2"><a href="../sitios_arqueol%F3gicos/index.html" SITIOS
ARQUEOL&Oacute;GICOS</a></div>
<div id="indice" style="position:absolute; left:01px; top:100px; width:251; height:768; z-index:3"></div>
<div id="Layer3" style="position:absolute; left:253px; top:100px; width:771px; height:768; z-index:4"></div>
</body>
</html>

muchas gracias
  #2 (permalink)  
Antiguo 30/12/2009, 20:29
Avatar de lucasphp  
Fecha de Ingreso: mayo-2009
Ubicación: Misiones
Mensajes: 170
Antigüedad: 15 años
Puntos: 3
Respuesta: no me carga en los divs

Hasta donde sé, esto está mal: ajax.open("GET", datos);
Debería ser: open("GET", url+datos, false);
  #3 (permalink)  
Antiguo 31/12/2009, 08:43
 
Fecha de Ingreso: noviembre-2009
Mensajes: 209
Antigüedad: 14 años, 6 meses
Puntos: 0
Respuesta: no me carga en los divs

ok, ya me funcina muchiiisimas gracias
FELIZ AÑO!!!!!
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 18:04.