Calling javascript function with php variable as parameter from php code block : <p>I have tried all the post of stack overflow and from google but none of those seem to work for me.
This is my php code:</p>

<pre><code>echo $firstPar;
echo $secondPar;
$tab_str.="&lt;td width=\"20%\"&gt;&lt;a href=\"#\" onclick = \"functionCall(".$firstPar.", ".$secondPar.")\" class=\"previous round\"&gt;&amp;#8249;&lt;/a&gt;";
</code></pre>

<p>This is the Javascript code:</p>

<pre><code>function functionCall(firstPar, secondPar) {
    alert(firstPar);
    alert(secondPar);
}
</code></pre>

<p>If I am passing string values directly on the php call rather than passing the variables, I am getting the values inside the function. But the variable values are coming as null. Whereas the echo displays the variable values.</p>
