replace function in jquery
<p>I am using following code </p>

<pre><code>$.post("insertPrivateMessage?action=sendchat", 
    { to: GroupUserArray[count], 
      message: message, 
      username: $("#author").val(),
      GROUP: chatboxtitle
    } , 
   function(data){
      message = message.replace(/&lt;/g,"&amp;lt;").replace(/&gt;/g,"&amp;gt;").replace(/\"/g,"&amp;quot;");
});
</code></pre>

<p>but when replacing message getting following error </p>

<p>message.replcace is not a function </p>

<p>is my code OK?</p>
