songhuihui

第一步:

首先你要引入jquery 和FileSaver.js

<script src="http://jquery.min.js"></script>

<script src="FileSaver.js"></script>

一定先引入以上两文件之后再引入jquery.wordexport.js 

<script src="jquery.wordexport.js"></script>

附件:在博客文件中 加上函数附件一共3个

第二步:

前台代码

<div id="pagecontent">

</div>

导出按钮

<a class="btn btn-primary jquery-word-export" href="javascript:void(0)">

导出
</a>

调用函数:

jQuery(document).ready(function ($) {
$("a.jquery-word-export").click(function (event) {
$("#pagecontent").wordExport($("input[name=\'wordfileName\']").val());
});
});

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-05
  • 2021-12-09
  • 2021-12-30
  • 2022-12-23
  • 2022-01-18
  • 2021-10-09
猜你喜欢
  • 2022-01-07
  • 2022-02-23
  • 2022-02-26
  • 2021-05-18
  • 2021-12-09
  • 2021-09-29
相关资源
相似解决方案