Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/10/2011, 09:56
JeduNiso
 
Fecha de Ingreso: octubre-2011
Mensajes: 2
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: capturar el tittle de un enlace javascript php

Muchas Gracias Bro!!!!!, genial era justo lo que necesitaba. Les muestro como quedo:
Código javascript:
Ver original
  1. <script language="javascript" type="text/javascript">
  2. function capturar(numero){
  3. var table = document.getElementById("prototipos");  
  4. var enlaces = table.getElementsByTagName("a");  
  5. for (var i = 0, total = enlaces.length; i < total; i ++)
  6.     if (i == numero)           
  7.         var enlace =document.getElementById('linka'+i);
  8. var titulo = enlace.title;
  9. $.post("nueva_rule.php", { variable: titulo }, function(data){
  10. $("#recargado").html(data);
  11. });
  12. }
  13. </script>
Código php:
Ver original
  1. <?php
  2. echo '<table id="prototipos" class="tabla">';
  3. for ($i=0;$i<$filas1;$i++){
  4. echo '<tr class="modo1">';
  5.  for($j=0;$j<$columnas1;$j++){
  6.     if($j==0){
  7.       $_SESSION['protos']=$matriz1[$i][$j];
  8.     }
  9.     if($j==1){
  10.       $aux1=$matriz1[$i][$j];
  11.       echo '<td width="100px" align="left"><a href="#" id="linka'.$i.'" title="'.$matriz1[$i][$j].'" onclick="javascript:capturar('.$i.')">'.$matriz1[$i][$j].'</a></td><tr>';
  12.     }
  13.  }
  14. }
  15. echo '</table>';
  16. ?>

Última edición por JeduNiso; 14/10/2011 a las 11:44