Cita:
Iniciado por Adler
Hola
Una de las maneras es como lo estás haciendo
Suerte
![dormir](http://static.forosdelweb.com/fdwtheme/images/smilies/durmiendo.png)
estas son mis funciones en js
Código Javascript
:
Ver originalfunction showunidad(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="php_consult/tipo_uni.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged3;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function stateChanged3()
{
if (xmlhttp.readyState==1)
{
document.getElementById("unidad").innerHTML= "<img src='anim.gif' align='center' />";
}
if (xmlhttp.readyState==2)
{
document.getElementById("unidad").innerHTML= "<img src='anim.gif' align='center' />";
}
if (xmlhttp.readyState==3)
{
document.getElementById("unidad").innerHTML= "<img src='anim.gif' align='center' />";
}
if (xmlhttp.readyState==4)
{
document.getElementById("unidad").innerHTML=xmlhttp.responseText;
}
}
function showUser2(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="php_consult/tipo_al.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged2;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function stateChanged2()
{
if (xmlhttp.readyState==1)
{
document.getElementById("prod").innerHTML= "<img src='anim.gif' align='center' />";
}
if (xmlhttp.readyState==2)
{
document.getElementById("prod").innerHTML= "<img src='anim.gif' align='center' />";
}
if (xmlhttp.readyState==3)
{
document.getElementById("prod").innerHTML= "<img src='anim.gif' align='center' />";
}
if (xmlhttp.readyState==4)
{
document.getElementById("prod").innerHTML=xmlhttp.responseText;
}
}
y ya sabes donde hago las llamadas!!
te repito el problema!!!
me habre una sola funcion pero repetida en los dos lugares
los div html son asi
haber como me puedes ayudar!! si puedes o recomendarme algo
o recomendar a otra persona para que me ayude!