i use jquery.ajax to save a rich text area .
corr=some.innerHTML(); /* corr='< some text <' */
$.ajax({
type:"POST", url:"flatplan/save_corr.php",
data:"corr="+corr+"&IDFS="+IDFILES,
success: function(msg){
},
error:function(x,e){
ajax_errors(x,e);
}
});
The problem is that the corr variable can contain ‘&’ chars inside and it send more params
giving problems. Is there any way to post with ajax html text?
You can (and should) escape query string components with
encodeURIComponent.Edit: jQuery can accept an Object in the data field. You should just use
so that jQuery can automatically encode the query string.