Well, before I proceed to another phase of my coding, just to make sure im not going to bark at the wrong tree, may I ask if it is possible to call a javascript function in php without any button click action to trigger it. i also dont consider onload() or onready() because im going to call the javascript function inside a foreach loop in php.. well the concept goes somehow like this:
<script type="text/javascript">
function callMe(){
alert('im called!');
}
</script>
<body>
<?php
.....
foreach($somevar as $var){
// assuming it will loop 5 times
callMe(); // well this is the part where im going to call the javascript function
}
?>
</body>
Thank you in advance.
******EDITED PART*****
here's the actual codes i plan to use:
function AddCoordinate( lat, long )
{
var path = LinePath.getPath();
path.push( new google.maps.LatLng( lat, long ) );
}
<?php
foreach($arrayOfPlotPoints as $key => $value){
$longitude = round($value['longitude'],5);
$latitude = round($value['latitude'],5);
$snrLevel = $value['snr_level'];
echo '<script
type="text/javascript">AddCoordinate('.$latitude.','.$longitude.')</script>
?>
actually that's the right answer..it already worked.. so im gonna provide an answer as well