function makeEditor() {
var oFCKeditor = new FCKeditor( 'MyTextarea' ) ;
oFCKeditor.BasePath = "/fckeditor/" ;
oFCKeditor.ReplaceTextarea() ;
}
function submitComment() {
var ed = FCKeditorAPI.GetInstance('MyTextarea') ;
httpRequest = getHTTPObject(); //deffined elsewhere
var postdata = '&content='+ed.GetXHTML.str.replace(/&/g, '%26')+'x=y';
httpRequest.open('POST', url, true);
httpRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
httpRequest.setRequestHeader('Content-length', postdata.length);
httpRequest.onreadystatechange = function() { submitResponse(httpRequest); }; //Where submitResponse is a funtion that would inform the user their comment was recieved by the server.
httpRequest.send(postdata);
}
Re: Which version to use for PHP and 'AJAX'?
function makeEditor() { var oFCKeditor = new FCKeditor( 'MyTextarea' ) ; oFCKeditor.BasePath = "/fckeditor/" ; oFCKeditor.ReplaceTextarea() ; }function submitComment() { var ed = FCKeditorAPI.GetInstance('MyTextarea') ; httpRequest = getHTTPObject(); //deffined elsewhere var postdata = '&content='+ed.GetXHTML.str.replace(/&/g, '%26')+'x=y'; httpRequest.open('POST', url, true); httpRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); httpRequest.setRequestHeader('Content-length', postdata.length); httpRequest.onreadystatechange = function() { submitResponse(httpRequest); }; //Where submitResponse is a funtion that would inform the user their comment was recieved by the server. httpRequest.send(postdata); }Re: Which version to use for PHP and 'AJAX'?
http://blogs.uct.ac.za/blog/lovemores-world/2008/10/27/post-fckeditor-form-with-ajax-solved