grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

[RePost] - Content html and update it by ajax

Open blackbirdzzz opened this issue 9 years ago • 2 comments

Hi you answer last time to my issues i wanted to change some content in html by some var

When i'm using this my console.log(finalHtml) display the good change, but i don't see anything on my browser i don't know if my ajax request in jquery is good see the code bellow thanks again for your answer

cmd.add('wikiopen', { run: function (editor, sender) { var finalHtml = editor.getHtml(); finalHtml = finalHtml.replace("test", "caca"); console.log(finalHtml); $.ajax({ type: "POST", url: window.location.href, data: {html: finalHtml} })

blackbirdzzz avatar Sep 01 '17 17:09 blackbirdzzz

I don't think I understand properly what you say... but maybe this is what you're looking for:

var finalHtml = editor.getHtml(); 
finalHtml = finalHtml.replace("test", "caca"); 
editor.setComponents(finalHtml)

artf avatar Sep 05 '17 12:09 artf

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Sep 18 '19 13:09 lock[bot]