Hey Guys i have a little issue of JavaScript and i don't know how to solve this Query that why i put this Question in stackoverflow also helps are definitely appreciated
I am getting the error missing ) after argument list in my Firebug console.
My Question is how to pass $char_data variable in JavaScript function as a argument
Define php variable
<?php
$chart_data = "['NBA',1],['NFL',2],['MLB',3],['NHL',4]";
$div = "graph";
?
Call Javascript function with define argument
<script>
dynamicChartArray('<?php echo $div;?>','<?php echo $chartdata;?>')
</script>
A function of javascrpit
<script>
function dynamicChartArray(div,chartdata){
var myData = new Array(chartdata);
var myChart = new JSChart(div, 'pie');
alert(chartdata+div);
}
<script>