How can i call a javascript function using php code with php variable passing
<p>This is my php code:</p>

<pre><code>&lt;?php
  $typeid = 65;
  $subledgerid = 'subledger'.$typeid;
  $loadledger = 'loadledgers';
   ?&gt;
   &lt;script type="text/javascript"&gt;view_subledger('&lt;?php echo $subledgerid;?&gt;',&lt;?php echo $typeid;?&gt;,'&lt;?php echo $loadledger;?&gt;');&lt;/script&gt;
</code></pre>

<p>This is not calling the <code>view_subledger()</code>.</p>

<p>But when i call something like this it will work fine:</p>

<pre><code>&lt;script type="text/javascript"&gt;view_subledger('subledger65',65,'loadledgers');&lt;/script&gt;
</code></pre>

<p>How can i call this?</p>
