0
I have the HTML files, ajax.js
and intrucao.js
as follows.
By clicking on agar.xml
the style sheet agar.xsl
is not loaded.
The addendum is that the shipment is made in a div
.
What is in the code that must be changed?
I have an HTML as follows:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Carregando Página em DIV / AJAX</title>
<script language="javascript" src="ajax.js"></script>
<script language="javascript" src="instrucao.js"></script>
</head>
<body>
<div id="menu"><a href="#" onclick="abrirPag('agar.xml');">xml</a></div>
<br><br>
<div id="conteudo_mostrar"></div>
</body>
The archive ajax.js
:
function GetXMLHttp() {
if(navigator.appName == "Microsoft Internet Explorer") {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
xmlHttp = new XMLHttpRequest();
}
return xmlHttp;
}
var xmlRequest = GetXMLHttp();
The archive instrucao.js
:
function abrirPag(valor){
var url = valor;
xmlRequest.open("GET",url,true);
xmlRequest.onreadystatechange = mudancaEstado;
xmlRequest.send(null);
if (xmlRequest.readyState == 1) {
document.getElementById("conteudo_mostrar").innerHTML = "<img src='loader.gif'>";
}
return url;
}
function mudancaEstado(){
if (xmlRequest.readyState == 4){
document.getElementById("conteudo_mostrar").innerHTML = xmlRequest.responseText;
}
}
some error in the console ? va a look presses F12
– Marcos Brinner
There is no error presented.
– Sócrates Santos