-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreandoajax.js
More file actions
65 lines (62 loc) · 1.56 KB
/
Copy pathcreandoajax.js
File metadata and controls
65 lines (62 loc) · 1.56 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// JavaScript Document
function devolverRequest()
{
if(window.XMLHttpRequest)//verificar xmlhttp request
{return new XMLHttpRequest();}
else if(window.ActiveXObject)
{
var versobj =new Array( 'Msxml2.XMLHTTP.5.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP','Microsoft.XMLHTTP');
for(var i=0;i<versobj.length;i++)
{
try
{return new ActiveXObject(versobj[i]);}
catch (ErrorControlado){}
}
}
throw new Error("no se pudo crear el ajaxrequest");
}
window.onload = function() {
listarAsientos();
};
//funciones
function tabla()
{
var entro= devolverRequest();
if(entro){
// document.write();
entro.open('get','formulario2.html',false);
entro.send(null);
document.getElementById('contenido').innerHTML = entro.responseText;
}
}
function listarAsientos()
{
var entro= devolverRequest();
if(entro){
alert("entro");
entro.open('get','asientos.php',false);
entro.send(null);
document.getElementById('listaAsientos').innerHTML = entro.responseText;
}
}
function factorial()
{
var entro= devolverRequest();
if(entro){
var a=prompt("introdusca el valor para calcular el factorial");
entro.open('get','factorial.php?valor='+a,false);
entro.send(null);
document.getElementById('contenido').innerHTML = entro.responseText;
}
}
function recibirca(a)
{
var entro= devolverRequest();
if(entro){
//alert("entro");
entro.open('get','invertirtexto.php?valor='+a,false);
entro.send(null);
document.getElementById('contenido').innerHTML = entro.responseText;
document.getElementById('contenido').style.background='red';
}
}