8000 Load text into CLEditor via ajax call · Issue #18 · cleditor/cleditor · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Load text into CLEditor via ajax call #18
Open
@Nicero

Description

@Nicero

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0