str.replace within a jquery function
<p>I have a simple jquery function as</p>

<pre><code>function sendValue(str){
    $.post("test.php",{ sendValue: str },
    function(data){
        $('#display').html(data.returnValue);
    }, "json");
}
</code></pre>

<p>I want to replace space within the string. I thought I can do this by adding</p>

<pre><code>str.replace(" ", "+");
</code></pre>

<p>to the second line of the function. But it did not work. I know very basic of javascript. How to replace " " with "+" in the string before posting data to test.php?</p>
