Hola, desde hace unos dias q observo q en la web carga no muy bien las capas y estoy en duda ya de que puede ser el error.
El codigo es el siguiente
Código HTML:
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, preloader;
contenido = document.getElementById('contenido');
preloader = document.getElementById('preloader');
ajax=NuevoAjax();
ajax.open("GET", url,true);
ajax.onreadystatechange=function(){
if(ajax.readyState==1){
preloader.innerHTML = " ";
preloader.style.background = "url('http://usuarios.lycos.es/gaiata2fadrell/imagenes/loading.gif') no-repeat";
}else if(ajax.readyState==4){
if(ajax.status==200){
contenido.innerHTML = ajax.responseText;
preloader.innerHTML = " ";
preloader.style.background = " ";
}else if(ajax.status==404){
preloader.innerHTML = "La página no existe";
}else{
// Esta linea da muchos errores
preloader.innerHTML = "Error:".ajax.status;
}
}
}
ajax.send(null);
}
Estas son mis dudas, esta linea hay q modificarla? ajax.open("GET", url,true);
Y lo segundo el erorr que sale es el siguiente. [string].ajax.status es nulo o no es un objeto.
Eso es todo, pero ya no veo donde me falla el codigo
gracias