Ver Mensaje Individual
  #24 (permalink)  
Antiguo 01/05/2012, 20:53
chinanzio
 
Fecha de Ingreso: marzo-2007
Mensajes: 82
Antigüedad: 17 años, 2 meses
Puntos: 21
Respuesta: Mas de una funcion/evento para el atributo onclick

Entonces el error está dentro la funcion hideuntilthanks_reload

puse unos comentarios en el codigo
Código Javascript:
Ver original
  1. var spinner = null;
  2.  
  3. function hideuntilthanks_reload() {
  4.     b1 = b;
  5.    
  6.     // ACA SPINNER SIEMPRE ES NULL (SEGUN ESTE SOLO TROZO DE CODIGO)
  7.     // POR LO TANTO LA FUNCION NO PASA DE ESTA LINEA
  8.     if (spinner) {
  9.         return false;
  10.     }
  11.    
  12.     // POR QUE USAS this.spinner AQUÍ ??? POR CASUALIDAD NO QUERRAS USAR LA VARIABLE SPINNER DECLARADA EN LA PRIMERA LINEA ??
  13.     this.spinner = new ActivityIndicator("body", {
  14.         image : "images/spinner_big.gif"
  15.     });
  16.     new Ajax.Request('{$mybb->settings[bburl]}/xmlhttp.php?action=hideuntilthanks_reload&my_post_key=' + my_post_key, {
  17.         method : 'post',
  18.         postBody : "",
  19.         onComplete : hideuntilthanks_done
  20.     });
  21.     return false;
  22. }
  23.  
  24. function hideuntilthanks_done(request) {
  25.     // ES QUE ACA TAMBIEN USAS this.spinner Y SEGUN ESTE TROZO DE CODIGO ESTO SIEMPRE VA A SER NULL
  26.     if (this.spinner) {
  27.         this.spinner.destroy();
  28.         this.spinner = '';
  29.     }
  30.     if (request.responseText.match(/<error>(.*)<\/error>/)) {
  31.         message = request.responseText.match(/<error>(.*)<\/error>/);
  32.         alert(message[1]);
  33.     } else if (request.responseText) {
  34.         $("hide_table").innerHTML = request.responseText;
  35.     }
  36. }
__________________
Hazle un favor a tu cerebro y juega Ajedrez online
Chess online