JQuery - pasar de ajax a jquery

 
Vista:
sin imagen de perfil

pasar de ajax a jquery

Publicado por bernardo (3 intervenciones) el 04/11/2014 16:29:56
hola mi dilema es que tengo un pequeño programa php el cual las funciones están en ajax, pero necesito pasarlas a jquery, les dejo el código que tengo si me pudiesen ayudar o explicar como lograrlo se lo agradeceria.

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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
function verModeloGoma(str)
{
	if (str=="")
	{
		document.getElementById("txtHint").innerHTML="";
		return;
	}
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
	}
	else
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
		document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
		}
	}
	xmlhttp.open("GET","obtenerGoma.php?q="+str,true);
	xmlhttp.send();
}
function obtenerDatos(str)
{
	if (str=="")
	{
		document.getElementById("txtHintn").innerHTML="";
		return;
	}
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
	}
	else
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
		document.getElementById("txtHintn").innerHTML=xmlhttp.responseText;
		}
	}
	xmlhttp.open("GET","datosGomas.php?g="+str,true);
 
	xmlhttp.send();
}
 
 
function verModeloMadero(str)
{
	if (str=="")
	{
		document.getElementById("txtHint1").innerHTML="";
		return;
	}
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
	}
	else
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
		document.getElementById("txtHint1").innerHTML=xmlhttp.responseText;
		}
	}
	xmlhttp.open("GET","obtenerMadero.php?ma="+str,true);
	xmlhttp.send();
}
function obtenerDatosMadero(str)
{
	if (str=="")
	{
		document.getElementById("txtHintn1").innerHTML="";
		return;
	}
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
	}
	else
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
		document.getElementById("txtHintn1").innerHTML=xmlhttp.responseText;
		}
	}
	xmlhttp.open("GET","datosMaderos.php?m="+str,true);
	xmlhttp.send();
}
 
function verModeloGomaNegra(str)
{
	if (str=="")
	{
		document.getElementById("txtHint2").innerHTML="";
		return;
	}
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
	}
	else
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
		document.getElementById("txtHint2").innerHTML=xmlhttp.responseText;
		}
	}
	xmlhttp.open("GET","obtenerGomaNegra.php?qo="+str,true);
	xmlhttp.send();
}
function obtenerDatosGomaNegra(str)
{
	if (str=="")
	{
		document.getElementById("txtHintn2").innerHTML="";
		return;
	}
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
	}
	else
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
		document.getElementById("txtHintn2").innerHTML=xmlhttp.responseText;
		}
	}
	xmlhttp.open("GET","datosGomaNegra.php?go="+str,true);
	xmlhttp.send();
    }
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder