-
Notifications
You must be signed in to change notification settings - Fork 1
/
cargar.js
executable file
·66 lines (60 loc) · 1.63 KB
/
cargar.js
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
function getHttpObject(){
var XMLHttp;
if (window.XMLHttpRequest) {
XMLHttp = new XMLHttpRequest();
} else if (window.ActiveXObject) {
XMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
return XMLHttp;
}
var http = getHttpObject();
function LoadTrait(){
var modelo = document.getElementById('selectModelo').value;
var listCar = document.getElementById('listaTrait');
if(http){
http.onreadystatechange = function(){
if(http.readyState==4 && http.status==200){
listCar.innerHTML=http.responseText;
}
}
http.open("GET","cgi-bin/loadTrait.pl?modelo="+modelo,true);
http.send();
}
}
function LoadIni(){
var listModel = document.getElementById('selectModelo');
if(http){
http.onreadystatechange = function(){
if(http.readyState==4 && http.status==200){
listModel.innerHTML=http.responseText;
}
}
http.open("GET","cgi-bin/loadIni.pl",true);
http.send();
}
}
function LoadAtr(codigoCar){
var pAtri = document.getElementById('panelAtributos');
if(http){
http.onreadystatechange = function(){
if(http.readyState==4 && http.status==200){
pAtri.innerHTML=http.responseText;
}
}
http.open("GET","cgi-bin/loadAtr.pl?codigoCar="+codigoCar,true);
http.send();
}
}
function LoadDel(){
var ver = document.getElementById('datos');
var codigo = document.getElementById('codigo').value;
if(http){
http.onreadystatechange = function(){
if(http.readyState==4 && http.status==200){
ver.innerHTML=http.responseText;
}
}
http.open("GET","cgi-bin/eliminar.pl?codigo="+codigo,true);
http.send();
}
}