javascript - Save edited data in ckeditor to html file -
i using ajax success function load content of html file ckeditor
function gettextinfo(fileurl) { $.ajax({ url: fileurl, success: function (data){ document.getelementbyid("myform").value = data; } }); }
and script call gettextinfo()
<script type="text/javascript"> $(document).ready(function(){ gettextinfo(filepath); }); </script>
and script load ckeditor
<script type="text/javascript"> ckeditor.replace( 'myform', { fullpage: true, allowedcontent: true, extraplugins: 'wysiwygarea' }) </script>
i need way save edited data editor html file. help.
you can use blob that. note used template string multi line string, other es5.
var somehtml = ` <html> <head> <title>some html</title> </head> <body> <h1>some html</h1> </body> </html>`; var blob = new blob([somehtml], {type : 'text/html'}); var url = url.createobjecturl(blob); document.body.innerhtml = '<a href="'+ url + '" download="some.html">download</a>';
Comments
Post a Comment