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

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -