Sending Post Parameters With Ajax

Hi!!!
I'm having a little problem with a web application I'm developing.
I need to send a query to a php script using post method of Ajax.
I created the variable where the query is stored and it looks like this:

consulta= barrio="Monserrat" or barrio="Palermo"&buscar=1;

this is in a variable called params...
The problem is that the php script never receibes de "consulta" variable, actually it receives it but it's empty...

I'm totally sure that the problem is that i need to scape same characters but i don't know how to do it... can someone help me????

Thanks!!!!

It's simple. Just call encodeURIComponent() function to escape individual values from Javascript before getting to XmlHttpRequest (or whatever wrapper you may be using).

This is the documentation:

https://developer.mozilla.org/en/Core\_JavaScript\_1.5\_Reference/Global_Functions/encodeURIComponent

oh! thanks!! it works great!!