Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/11/2010, 15:01
Avatar de truman_truman
truman_truman
 
Fecha de Ingreso: febrero-2010
Ubicación: /home/user
Mensajes: 1.341
Antigüedad: 14 años, 2 meses
Puntos: 177
Llamar funcion dentro de otra Javascript

Hola a todos tengo una duda con una funcion que llama a otra.
el codigo es el siguiente


Código Javascript:
Ver original
  1. function horaServidor() {
  2.   var myurl = 'dimehoraXML.php';
  3.   myRand = parseInt(Math.random()*999999999999999);
  4.   var modurl = myurl+"?rand="+myRand;
  5.   http.open("GET", modurl, true);
  6.   http.onreadystatechange = useHttpResponse;
  7.   http.send(null);
  8. }
  9.  
  10.  
  11. function useHttpResponse() {
  12.  
  13.    if (http.readyState == 4) {
  14.  
  15.     if(http.status == 200) {
  16.        var timeValue = http.responseXML.getElementsByTagName("timenow")[0];
  17.        document.getElementById('showtime').innerHTML = timeValue.childNodes[0].nodeValue;
  18.     }
  19.  
  20.   } else {
  21.   document.getElementById('showtime').innerHTML = '<img src="anim.gif">';
  22.   }
  23.  
  24. }



En esta linea :
http.onreadystatechange = useHttpResponse;

se llama a la funcion useHttpResponse, pero mi duda es : POR QUE NO LLEVA los parentesis ??? osea asi useHttpResponse()


Gracias a todos Saludos
__________________
la la la