how to send string value from php page to java script page
<p>I am storing a string value in one php variable.I want to send this value to a function on image click. Here is code</p>

<pre><code>userfn.php

$actvitycode = "AG001";
&lt;img src="phpimages/addicon.gif" onclick="showData('.$actvitycode.')"&gt;&lt;/img&gt;



getdata.js

function showData(actcode)
{
  alert(actcode);
  document.getElementById("tasklist").value = actcode;
}
</code></pre>

<p>Problem is, on image click the function is not calling. 
FYI: If I store integer value (ex:2342) in $actvitycode the function is successfully called and alert is showing the result. The problem with the string value only. I tried with several syntaxes like</p>

<pre><code>onclick="showData("'.$actvitycode.'")"
onclick="showData($actvitycode)"
</code></pre>

<p>but no one syntax is giving result. Please provide me correct syntax.</p>
