Hi folks
I have a web page being built using string functions which append html together
then issue one echo statement to present the html page.
I load the fckeditor and any content from a database record. All works fine
and good except since the html code to be placed in the fckeditor is so long, sometimes
the text wraps in the javascript area which gives a error.
I tried removing line breaks with no luck
When the page is echoed out how can I make sure oFCKeditor.Value doesn't wrap causing a error on load.
J
I have a web page being built using string functions which append html together
then issue one echo statement to present the html page.
I load the fckeditor and any content from a database record. All works fine
and good except since the html code to be placed in the fckeditor is so long, sometimes
the text wraps in the javascript area which gives a error.
I tried removing line breaks with no luck
$fckbody = str_replace("\n","", $page_data["page_body"]); $fckbody = str_replace("\r","", $fckbody); $rpt_build .= "<script type=\"text/javascript\">\n". "var oFCKeditor = new FCKeditor('pagecopy');\n". "oFCKeditor.BasePath = \"fckeditor/\";\n". "oFCKeditor.Height = \"400\";\n". "oFCKeditor.Value = \"".$fckbody."\";\n". "oFCKeditor.Create();\n". "</script>\n";
When the page is echoed out how can I make sure oFCKeditor.Value doesn't wrap causing a error on load.
J
Re: Loading Content via javascript
$fckbody = preg_replace("/[\r\n]+[\s\t]*[\r\n]+/", '<br>',$fckbody ) ;
where $fckbody is the text to go into the editor.
J