I am trying to send a form to a PHP file via jQuery. The problem is, that the content, which has to be sent to the PHP file, contains slashes (/
) since there is BBcode inside.
So I tried the following:
$.ajax(
{
type: "POST",
url: "create.php",
data: "content=" + encodeURIComponent(content),
cache: false,
success: function(message)
{
$("#somediv").html(message);
}
});
In the PHP file I use rawurldecode()
to decode the content and get my BBcodes back which I can then transform into HTML. The problem is as soon as I put the encodeURIComponent()
it will output: [object HTMLTextAreaElement]
What does that mean, where is my mistake?