Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/12/2009, 02:04
gazaposa
 
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