For some reason when I pass the following text to FCKEditor, it bombs out with an Unterminated string constant javascript error. I am passing it from a MySQL query through a php variable after I pass it through the addslashes() function. If I use a simple string like asdasd it works fine. It even works if I add single or double quotes to the string, but something in this text causes it to not load:
<table>
<tbody>
<tr>
<td>A</td>
<td>A</td>
</tr>
<tr>
<td>A</td>
<td>A</td>
</tr>
<tr>
<td>A</td>
<td>A</td>
</tr>
</tbody>
</table>
Thanks for any help
<table>
<tbody>
<tr>
<td>A</td>
<td>A</td>
</tr>
<tr>
<td>A</td>
<td>A</td>
</tr>
<tr>
<td>A</td>
<td>A</td>
</tr>
</tbody>
</table>
Thanks for any help
RE: Unterminated string constant error
RE: Unterminated string constant error
I doubt that quoting the \' was the solution. I'm having a similiar problem.

My issue is that setting .Value to a string with line breaks means I have to quote handle quoting a multiline string
so in your example I get
var myval = '<table>';
myval += '<tbody>';
...
oFCKeditor.Value = myval;
there has got to be a better way to handle multiline default values
RE: Unterminated string constant error
I replaced all quotes (") with \"
The server side javascript was:
outString = inString.replace(/\"/g,"\\\""); // replace " with \"
outString = outString.replace (/\n/g,"\\n");// replace carriage return with \n
-Dave
RE: Unterminated string constant error
Another way to solve this probelm would be to use the TextareaReplace method.
http://fckeditor.wikiwikiweb.de/Develop ... Javascript
You can have as many linefeeds and quotes as you like between the textarea tags. You will have to convert HTML tags to character entities however.