how can i get array value from php to javascript, and use the value for other function in javascript? here is my source code:
<?php
$sSql = "SELECT * from contactinfo order by description, nama_cp";
$r1 = $dbconn->execute ($sSql);
$idset=array();
$no=1;
while (($r1) && (!$r1->EOF)) {
$s1 = $r1->GetRowAssoc(false);
$idset[$no]=$s1[id];
$no++;
}
?>
<script type="text/javascript">
function getdata(valarray){
//source..
}
$(document).ready(function() {
var line=<?php echo($no); ?>;
var i;
for(i=1;i<line;i++){
$("#action"+i).click(function() {//button, that named with action+int
//var valarray = ??? -------->value of array idset;
getdata(valarray);//use data array for other function..
});
}
});
</script>
in this code, i want to use valarray in function getdata().