【背景】
之前已经实现了:
网页中,点击某个按钮,可以调用到js获得到KindEditor的html的内容:
function submitGoodsContent()
{
var kindeditor = window.editor;
// 取得HTML内容
html = kindeditor.html();
console.log(html);
}
商品名:
在此输入新产品的介绍内容
提交当前页面
现在希望实现,不仅仅是获得HTML内容, 而是保存html内容到html文件,并保存到服务器的本地。便于后期加载。
【解决过程】
1.搜:
js save html to file
参考:
->
顺便看看demo:
下载得到:
FileSaver.js-master.zip
发现还要下载:
2.然后把对应js文件放到对应位置:
用了下面的代码:
(1)父页面中引用了js:
index.jsp
(2)子页面中的代码:
function submitGoodsContent()
{
var kindeditor = window.editor;<