Passing a string to a javascript and retrieving it further
<p>I am passing a string to a javascript through call by reference. The string is a text retrieved from a textarea field. The problem is that a single word is retrieved properly, but when I send multiple text it shows a problem. The sample code is like this in a php file,
The txt is the name of textarea field. If I type hello in the field and send it works properly but whenever I type string like "hello india", it gives a problem and nothing is retrieved</p>

<p>Sample code for post.php is like this :</p>

<pre><code>&lt;?php
$msg=$_GET['msg'];
$v1=$_GET['v1'];
$v2=$_GET['v2'];
    &lt;textarea name="txt" id="txt"&gt;
    &lt;input type=button onclick="send(txt.value,123,456)"&gt;
?&gt;
</code></pre>

<p>The send() method is not a standard method. Its a custom method which passes variables to a file through GET method. The txt is the name of the textarea column. The send method works like this:</p>

<pre><code>function send(str,var1,var2)
{
$('#loader').html('loading');
$('#postarea').load('post.php?msg='+str+'&amp;v1='+var1+'&amp;v2='+var2);
}
</code></pre>
