Issue
I'm using Froala WYSIWYG editor, I use ajax to add comments, so I have to empty the editor when data are successfuly inserted. but it doesn't work!!!! here are my codes:
type: 'POST',
url: 'article_functions/add_comment.php',
data :{ comment : comment, article : article, user : user },
beforeSend: function()
{
$('img.comment_loader').show();
},
success: function(data)
{
$('img.comment_loader').hide();
$('div#all_comments').append("// here is the inserted comment");
$('textarea#core').val('');
},
error: function(data)
{
$('img.comment_loader').hide();
alert(data);
}
As you see, I use the .val('')
to clean the editor.
what's the problem guys ?
Solution
You should use $('YOUR_SELECTOR').editable('setHTML', '', true);
Answered By - st3fan Answer Checked By - Katrina (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.