Ver Mensaje Individual
  #7 (permalink)  
Antiguo 14/09/2010, 13:14
Avatar de dohko1
dohko1
 
Fecha de Ingreso: septiembre-2010
Mensajes: 28
Antigüedad: 14 años, 5 meses
Puntos: 0
Respuesta: Duda con Funciones de Java

Cita:
Iniciado por Adler Ver Mensaje
Hola


Una de las maneras es como lo estás haciendo

Suerte

estas son mis funciones en js

Código Javascript:
Ver original
  1. function showunidad(str)
  2. {
  3. xmlhttp=GetXmlHttpObject();
  4. if (xmlhttp==null)
  5.   {
  6.   alert ("Browser does not support HTTP Request");
  7.   return;
  8.   }
  9. var url="php_consult/tipo_uni.php";
  10. url=url+"?q="+str;
  11. url=url+"&sid="+Math.random();
  12. xmlhttp.onreadystatechange=stateChanged3;
  13. xmlhttp.open("GET",url,true);
  14. xmlhttp.send(null);
  15. }
  16.  
  17.  
  18. function stateChanged3()
  19. {
  20.  
  21.     if (xmlhttp.readyState==1)
  22. {
  23. document.getElementById("unidad").innerHTML= "<img src='anim.gif' align='center' />";
  24. }
  25.     if (xmlhttp.readyState==2)
  26. {
  27. document.getElementById("unidad").innerHTML= "<img src='anim.gif' align='center' />";
  28. }
  29.     if (xmlhttp.readyState==3)
  30. {
  31. document.getElementById("unidad").innerHTML= "<img src='anim.gif' align='center' />";
  32. }
  33. if (xmlhttp.readyState==4)
  34. {
  35. document.getElementById("unidad").innerHTML=xmlhttp.responseText;
  36. }
  37. }
  38.  
  39. function showUser2(str)
  40. {
  41. xmlhttp=GetXmlHttpObject();
  42. if (xmlhttp==null)
  43.   {
  44.   alert ("Browser does not support HTTP Request");
  45.   return;
  46.   }
  47. var url="php_consult/tipo_al.php";
  48. url=url+"?q="+str;
  49. url=url+"&sid="+Math.random();
  50. xmlhttp.onreadystatechange=stateChanged2;
  51. xmlhttp.open("GET",url,true);
  52. xmlhttp.send(null);
  53. }
  54.  
  55.  
  56. function stateChanged2()
  57. {
  58.  
  59.     if (xmlhttp.readyState==1)
  60. {
  61. document.getElementById("prod").innerHTML= "<img src='anim.gif' align='center' />";
  62. }
  63.     if (xmlhttp.readyState==2)
  64. {
  65. document.getElementById("prod").innerHTML= "<img src='anim.gif' align='center' />";
  66. }
  67.     if (xmlhttp.readyState==3)
  68. {
  69. document.getElementById("prod").innerHTML= "<img src='anim.gif' align='center' />";
  70. }
  71. if (xmlhttp.readyState==4)
  72. {
  73. document.getElementById("prod").innerHTML=xmlhttp.responseText;
  74. }
  75. }

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

Código HTML:
Ver original
  1. <div id="prod">                </div>
  2.                 <div id="unidad">             </div>

haber como me puedes ayudar!! si puedes o recomendarme algo

o recomendar a otra persona para que me ayude!