Skip to content
Advertisement

How to hide the value of a javascript function?

I have looked through several questions and have not found what I am looking for. In my code creating a table from a mysql query. Each cell is a link to a javascript function and I would like to pass the value to the function to be processed. I would like to know how I can hide that value from someone and still pass the value. I am new to javascripting and need a little help.

How can I hide:

<td class="tg-baqh" style="text-align:center">
    <a href="javascript:doSomethingElse(<?php echo $rowlgs0[0];?>);"><?php echo $rowlgs0[1]; ?></a>
</td>

From someone viewing source code?

 <table class="tgd1">
  <tr>
    <th class="tg-baqh" colspan="3">Players in the Season Above</th>
  </tr>
  <tr>
    <td class="tg-baqh" style="text-align:center" width="20%">Player</td>
    <td class="tg-baqh" style="text-align:center" width="8%">City</td>
    <td class="tg-baqh" style="text-align:center" width="8%">State</td>
  </tr>
  <?php  while($rowlgs0 = mysqli_fetch_array($resplyrslg0)){ ?>
  <tr>
    <td class="tg-baqh" style="text-align:center"><a href="javascript:doSomethingElse(<?php echo $rowlgs0[0];?>);"><?php echo $rowlgs0[1]; ?></a></td>
    <td class="tg-lqy6" style="text-align:center"><?php echo $rowlgs0[6]; ?></td>
    <td class="tg-lqy6" style="text-align:center"><?php echo $rowlgs0[7]; ?></td>
  </tr>
<?php  }  ?>
</table>

Advertisement

Answer

if you want to hide in the link then you can use PHP ‘post’ method:

 for example in your link:

<td class="tg-baqh" style="text-align:center"><a href="javascript:doSomethingElse(<?php echo $rowlgs0[0]; method ='post'?>);"><?php echo $rowlgs0[1]; ?></a></td>
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement