Issue with dynamically generated javascript link with PHP
<pre><code>&lt;a href="javascript:exampleFunction(&lt;?php echo $val;?&gt;)"&gt;example link&lt;/a&gt;
</code></pre>

<p>returns PHP error:</p>

<blockquote>
  <p>syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';'</p>
</blockquote>

<p>Any ideas? (Hope this question makes sense. I'm trying to fix someone else's code.) </p>
