FCKEditor and Ajax Requests

This took me a while to figure out, so I hope this little tidbit helps someone…

If you want to send XHTML over GET or POST in an Ajax request with FCKEditor, be sure to do something like this:

var pars = 'page_content=' + escape(FCKeditorAPI.GetInstance('page_content').GetXHTML());

The critical part of this is escape() – it is the javascript equivalent of PHP’s urlencode.