Código Javascript
:
Ver originalfunction ajaxFunction() {
var xmlHttp;
try {
xmlHttp=new XMLHttpRequest();
return xmlHttp;
} catch (e) {
try {
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
return xmlHttp;
} catch (e) {
try {
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
return xmlHttp;
} catch (e) {
alert("Tu navegador no soporta AJAX!");
return false;
}}}
}
function clic(_pagina,capa2) {
var ajax;
ajax = ajaxFunction();
ajax.open("GET", _pagina, true);
ajax.setRequestHeader("Content-Type", "text/html");
/*ajax.setRequestHeader("Content-Type", "text/html; charset=iso-8859-1")*/
ajax.setRequestHeader("encoding", "utf-8");
ajax.onreadystatechange = function() {
if (ajax.readyState==1){
document.getElementById(capa2).innerHTML = " Cargando...";
}
if (ajax.readyState == 4) {
document.getElementById(capa2).innerHTML=ajax.responseText;
}}
ajax.send(null);
}