Open
Description
I would like to load some text retrieved from a dB into a CLEditor driven textarea.
The user clicks a link:
<a class="editlink" id="<?php echo $review['id']; ?>" href="#"><?php echo $review['title']; ?></a>
JQuery passes the ID to GO.PHP:
$(".editlink").click(function() {
$.get("go.php", {param: $(this).attr('id')},
function(data) {
$(#area1').html(data);
});
return false;
});
GO.PHP retrieves the text from the dB:
$qry = mysql_query("SELECT * FROM reviews WHERE id = ".$_GET['param']." ");
while($review = mysql_fetch_array($qry)) {
echo $review['description'];
}
and the HTML:
<textarea id="area1" rows="30" cols="55"></textarea>
As confirmed by Firebug consolle, ID and the text are retrieved correctly. The problem I noticed is that when CLEditor is active, loaded and working I need to refresh the page to see the text loaded into the textarea. If CLEditor is not loaded, the text is loaded via ajax suddently without any page refresh.
I did read about :
editor.$area.val(htmltext);
editor.updateFrame();
but as I'm still learning jQuery would someone be so kind to add these two lines into my above code?
Metadata
Metadata
Assignees
Labels
No labels