Saturday, 31 August 2013

Call Javascript function with paramters inside PHP

Call Javascript function with paramters inside PHP

I have a javascript function which has some paramters (an array). I want
to call it inside php. Following is my code
<script type="text/javascript">
<?php
$task_list=array();
foreach($tasks as $row2){
$task_list=$row2;
}
echo "display_diagram(".$task_list.");";
?>
function display_diagram(var1){
.........................
.........................
}
When I call it without any parameter it is working (I could displayed the
content in jacascript function. But when I give the parameter( it is an
array it dose not working. Could you give this a solution ?

No comments:

Post a Comment