-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunc.js
More file actions
42 lines (31 loc) · 910 Bytes
/
func.js
File metadata and controls
42 lines (31 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function createRequestObject() {
var objeto;
if (navigator.appName == "Microsoft Internet Explorer") {
objeto = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
objeto = new XMLHttpRequest();
}
return objeto;
}
function sendRequest2() {
var http2 = createRequestObject();
http2.open("GET", "index.php?buscar=2", true);
http2.onreadystatechange = function () { handleResponse2(http2); };
http2.send();
}
function handleResponse2(http2) {
var response2;
if (http2.readyState == 4) {
response2 = http2.responseText;
if (response2.substr(response2.length - 2) == "--") {
window.location.href = "index.php";
} else {
document.getElementById("procesador").innerHTML = response2;
sendRequest2();
}
}
}
function Iniciar() {
sendRequest2();
}