<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<script language="JavaScript" type="text/javascript">
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 comprobar(url){
var encontrado
ajax=NuevoAjax();
ajax.open("GET", url,true);
ajax.onreadystatechange=function(){
if(ajax.readyState==1){
//un preload por si es necesario
//contenido.innerHTML ="Cargando....";
}
else if(ajax.readyState==4){
if(ajax.status==200){
alert(ajax.responseText);
}
}
}
ajax.send(null);
}
//==========================================================
</script>
</head>
<body>
<form method="POST">
<input type="text" onchange="comprobar('comprobador.php?buscar='+this.value);" name="campo1" />
<input name="campo2" />
</form>
</body>
</html>