[Resolvido] Ajax - Aceeo Negado quando uso no IE
Ola pessoal
Estou tendo um problema com uma pagina
quando mando ela carregar a pagina via Ajax ele me da um erro de acesso negado., mas so no IE no FF ele funciona direito.
meu JS
function ajax() {
};
ajax.prototype.iniciar = function() {
try{
this.xmlhttp = new XMLHttpRequest();
}catch(ee){
try{
this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(E){
this.xmlhttp = false;
}
}
}
return true;
}
ajax.prototype.ocupado = function() {
estadoAtual = this.xmlhttp.readyState;
return (estadoAtual && (estadoAtual < 4));
}
ajax.prototype.processa = function() {
if (this.xmlhttp.readyState == 4 && this.xmlhttp.status == 200) {
return true;
}
}
ajax.prototype.enviar = function(url, metodo, modo) {
if (!this.xmlhttp) {
this.iniciar();
}
if (!this.ocupado()) {
if(metodo == "GET") {
this.xmlhttp.open("GET", url, modo);
this.xmlhttp.send(null);
} else {
this.xmlhttp.open("POST", url, modo);
this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859-1");
this.xmlhttp.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
this.xmlhttp.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
this.xmlhttp.setRequestHeader("Pragma", "no-cache");
this.xmlhttp.send(url);
}
if (this.processa) {
return unescape(this.xmlhttp.responseText.replace(/\+/g," "));
}
}
return false;
}
function ajaxCarregaPagina(URL, Metodo, Modo,Campo){
Remoto = new ajax();
//alert(Remoto);
var xmlhttp = Remoto.enviar(URL, Metodo, Modo);
//alert(xmlhttp);
getID(Campo).innerHTML = xmlhttp;
return false;
}
meu HTML
<!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">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/estilos.css" />
<script language="javascript" type="text/javascript" src="js/fc_ajax.js"></script>
<title>Untitled Document</title>
</head>
<body>
<div id="menu" class="menu">
<ul>
<li>
<a href="#" id="linkEsportes">Esportes</a>
</li>
</ul>
</div>
<div id="conteudo" class="conteudo"></div>
</body>
</html>
<script language="javascript" type="text/javascript">
getID('linkEsportes').onclick = function(){ajaxCarregaPagina("esporte.html","POST",false,"conteudo");}
</script>agora, o que estou fazendo de errado?
ja li em outros post e tentei colocar o caminho completo, porem, tb nao funcionou
se alguem puder me dar uma ajuda
T+
abs
Discussão (4)
Carregando comentários...