Hello,
I'm trying to understand the best practice for using fckeditor in ajax configuration.
I was using fckeditor from PHP and it worked fine. From PHP when I did a save the post returned to the server for a non breaking space
Now I converted my page to ajax. I have an OnSaveContent() function that gets the FCKEditor content by making a call to oEditor.GetHTML(true). I tried using GetXHTML(), GetData() passing both true and false. I was never able to get FCKEditor to produce the same HTML as the non Ajax version.
Can someone please expand on the best way to do this.
The code I am referencing is below. I'm not sure whe there is a linebreak after line 8, its not in the post. Thanks for the advice.
Sincerely,
Barry Breaux
I'm trying to understand the best practice for using fckeditor in ajax configuration.
I was using fckeditor from PHP and it worked fine. From PHP when I did a save the post returned to the server for a non breaking space
&NBSP looked like this: FCKeditor1=%26nbsp%3Band its all good.
Now I converted my page to ajax. I have an OnSaveContent() function that gets the FCKEditor content by making a call to oEditor.GetHTML(true). I tried using GetXHTML(), GetData() passing both true and false. I was never able to get FCKEditor to produce the same HTML as the non Ajax version.
FCKeditor1= Which, of course, gets interpreted as a new post Name/Value. Of course I can solve this problem by doing HTMLEncode(oEditor.GetHTML(true)). I suspect there is some way to get FCKEditor to give me an Encoded string.
Can someone please expand on the best way to do this.
The code I am referencing is below. I'm not sure whe there is a linebreak after line 8, its not in the post. Thanks for the advice.
Sincerely,
Barry Breaux
function OnSaveContent(){
var OEditor;
oEditor = FCKeditorAPI.GetInstance('FCKeditor1');
$.ajax({
type:"POST",
url:"/ajax_server/html/svr_dynamic_content.php",
data:"SLPageID="+SLPageID+"&SLPageName="+SLPageName+"&request=Post&page="+Page+"&PageID="+$('#PageID').val()+"&ContentID="+$('#ContentID').val()+"&HTML="+oEditor.GetHTML(true),
cache:false,
success:function(html){
$("#SL_DynamicContent").html(html);
$("#pager").pager({ pagenumber: Page, pagecount: PageCt, buttonClickCallback: PageClick });
}
});
}