http://zlatylist.org
<script type=\"text/javascript\"> <!-- // Automatically calculates the editor base path based on the _samples directory. // This is usefull only for these samples. A real application should use something like this: // oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value. var oFCKeditor = new FCKeditor( 'content' ) ; oFCKeditor.BasePath = 'ukazky/nic/fckeditor/' ; oFCKeditor.Height = 500 ; oFCKeditor.Value = '$content_textarea' ; oFCKeditor.Create() ; //--> </script>
<?php $content_textarea="aaaaaaaaaaaa bbbbbbbbbbbb cccccc"; ?> ............ ...... oFCKeditor.Value = '$content_textarea' ; ......
oFCKeditor.Value = 'aaaaaaaaaaaa bbbbbbbbbbbb cccccc' ;
oFCKeditor.Value = 'aaaaaaaaaaaa' +'bbbbbbbbbbbb' +'cccccc' ;
oFCKeditor.Value = 'aaaaaaaaaaaa<br />bbbbbbbbbbbb<br />cccccc' ;
$content_textarea = Str_Replace("\n", "<br />", $content_textarea);
........
oFCKeditor.Value = 'aaaaaaaaaaaa
<br />bbbbbbbbbbbb
<br />cccccc' ;
...
Re: Can I fix \n in jscript?
You could maybe try something like (in PHP, before you print it out)...
$c = explode("\r\n",$content_textarea); // or $c = explode(PHP_EOL,$content_textarea); $content_textarea = implode('<br/>',$c);however there is little point to this as you could just use
include("fckeditor/fckeditor.php"); $oFCKeditor = new FCKeditor( 'content' ) ; $oFCKeditor->BasePath = 'ukazky/nic/fckeditor/' ; $oFCKeditor->Height = 500 ; $oFCKeditor->Value = $content_textarea; $oFCKeditor->Create() ;in your php file, then you wouldn't have to worry about the new line error.
Hope this helps
Re: Can I fix \n in jscript?