How to encode text using jquery?
<p>I'm using ajax() to send POST request to a php page. This is the code:</p>

<pre><code>  date     = $.trim($('#date').val()) 
  expiry   = $.trim($('#expiry').val()) 
  priority = $.trim($('#priority').val()) 
  note     = $.trim($('#note_text').val())

  $.ajax({
    type: "POST",
    url:  "client?method=addNote&amp;id=10",
    data: "date="+date+"&amp;expiry="+expiry+"&amp;priority="+priority+"&amp;note="+note,
    success: function(msg){
      alert(msg);
    }
  });
</code></pre>

<p>my problem is that the last variable named note could has many "strange" characters, like: <code>&amp; % $ / : ; , .</code></p>

<p>I have seen that the php page is no receiving all the "note" string correctly. If it found (&amp;) it js "truncate" the string. <em>how could I encode that text?</em></p>
