Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/01/2014, 19:01
Avatar de satjaen
satjaen
 
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 12 años, 5 meses
Puntos: 10
Pasar variable con evento ondblclick

Por favor, estoy intentado pasar una variable pulsando en una fila pero no me sale.

Código Javascript:
Ver original
  1. <script language="javascript">
  2.  
  3. var fila= null;
  4. function cogerDato(obj, id_aviso) {
  5.   obj.style.background = 'grey';
  6.   if (fila != null && fila != obj)
  7.     fila.style.background = 'white';
  8.   fila = obj;
  9.  window.location ="plantilla_factura.php?id="+id_aviso;
  10. }
  11.  
  12. </script>
  13. <body>
  14.  <div id="aparato">
  15.      <table width="100%">
  16.        <thead>
  17.          <tr>
  18.          
  19.          <tr bgcolor=#DFEBFF id=t70 onclick='coloreaf(70,1)' onMouseOver='coloreamosin(70,1)' onMouseOut='coloreamosout(70,1)'>
  20.              <th><span title="aparato">Nº Aviso</span></th>
  21.          </tr>
  22.          <?php do { ?>
  23. <tr ondblclick="cogerDato(this, ' + *String.fromCharCode(39) + <?php echo $row_ap_usuarios['id_aviso']; ?> + String.fromCharCode(39) *+ ')" >
  24.             <th><?php echo $row_ap_usuarios['id_aviso']; ?></th>
  25.          </tr>
  26.           <?php } while ($row_ap_usuarios = mysql_fetch_assoc($ap_usuarios)); ?>  
  27.        </thead>
  28.        <tbody>
  29.          </tbody>
  30.   </table>
  31.   </div>
  32. </body>
  33. </html>

Un saludo