new Ajax.Request('myactions.php',
{
method:'get',
parameters: {action:'bringeditor', id:<?php echo $uid; ?>},
onSuccess: function(transport){
var response = transport.responseText;
var data = response.evalJSON();
$('maincontent').innerHTML=data.mytextarea;
eval(data.jsaction);*/
},
onFailure: function(){ alert('Something went wrong...') }
});
and in 'myactions.php' :
$textarea= "<textarea id='MyTextarea' name='MyTextarea'>
$txtareacontent</textarea>\\n";
header("Content-type: text/javascript");
$jsaction= "var oFCKeditor = new FCKeditor('MyTextarea');\\n";
$jsaction.= "oFCKeditor.ReplaceTextarea();\\n";
echo "{mytextarea: $textarea, jsaction: $jsaction}";
now the problem is that i dunno what user enters in the editor, and
i've got problems handling characters that may conflict with the JSON
request ( like " \ \n etc) what can i do ? i tried $H ... no use. thX
I'd suggest just building the textarea in the page and hiding until
the user needs it, lazy loading like that can be a big headache as im
sure you already know.
To avoid complications with forward slashes you could use the string
method, addslashes. http://us2.php.net/manual/en/function.addslashes.php
Cheers,
Matt
On Sep 28, 1:29 pm, "parsa.ghaff...@gmail.com"