Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/02/2013, 19:24
Avatar de Luisa29
Luisa29
 
Fecha de Ingreso: enero-2013
Mensajes: 193
Antigüedad: 11 años, 3 meses
Puntos: 4
Pregunta ¿Alguien me chequea esto?

No sé donde puede estar el fallo, los botones no funcionan.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento</title>


<style type="text/css">
<!--
@import url("estilo1.css");
-->
</style>
<script>
function nuevoAjax(){

var xmlhttp=false;
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 Cargar(url){


var contenido = document.getElementById('contenido');

ajax=nuevoAjax();
ajax.open("GET", url,true);
ajax.onreadystatechange=function(){

if(ajax2.readyState==4){

contenido.innerHTML=ajax.responseText;

}

}

ajax.send(null);



}
</script>
</head>

<body>
<div id="menu"><?php include("menu.php"); ?></div>
<div id="contenido"><?php include("contenido1.php"); ?></div>
</body>
</html>


Y esto para menu.php

<a href="#" onclick="Cargar('contenido1.php');">Link1</a><br />
<a href="#" onclick="Cargar('contenido2.php');">Link2</a><br />
<a href="#" onclick="Cargar('contenido3.php');">Link3</a><br />


Pero no funciona. ¿Alguien sabe cual es el fallo?