I have a question about php and javascript. I'm new about this.
I have a php array and I use a php function to visualize these informations in the page. In particular I use a Jquery table and I have this simple php script to generate this table:
In the html <body> tag i have:
<table cellspacing="1" class="tablesorter">
<thead>
<tr>
<th>GoTo</th>
<th>Latitude</th>
<th>Longitude</th>
<th>OtherInfo</th>
<th>Saved</th>
</tr>
</thead>
<tbody id="table">
<?php
$index = 0;
foreach ($entries as &$value) {
echo("<tr><td><a href=\"javascript:moveToLocation($value->latitude,$value->longitude,'$value->otherInfo');\">Go to</a></td>");
echo("<td>".$value->latitude."</td>");
echo("<td>".$value->longitude."</td>");
echo("<td>".$value->otherInfo."</td>");
echo("<td id=textNotsaved>Not saved</td>");
echo("</tr>");
echo("<script> addMarker(".$value->latitude.",".$value->longitude.",".$index."); </script>");
$index++;
}
?>
</tbody>
</table>
Now, I would to use some javascript functions (so, javascript events) to modify some cells of my table.
1) What is the best way for this?
2) My php array correspond to my model (if I would to consider MVC into my simple page), is possible tho modify a php variable using javascript?