使用脚本函数下载PDF文件

时间:2017-06-29 10:35:59

标签: javascript php jquery pdf

我有js脚本来下载excel文件

这里我的代码..我的Excel文件下载功能中的一些错误忽略了..



<script>
  $('#donwload').on('click', function() {
  // get the table id
  $("#tab").table2excel();
});
</script>
&#13;
<table style="width:100%" id="tab">
  <tr>
    <th>Firstname</th>
    <th>Lastname</th> 
    <th>Age</th>
  </tr>
  <tr>
    <td>Jill</td>
    <td>Smith</td>
    <td>50</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td>
    <td>94</td>
  </tr>
  <tr>
    <td>John</td>
    <td>Doe</td>
    <td>80</td>
  </tr>
</table>
<button id="donwload" class="downloadbutton1">Download</button>

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>


<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script src="https://public.azurewebsites.net/js/jquery.table2excel.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
&#13;
&#13;
&#13;

就像我希望PDF文件下载没有任何PHP代码写入PDF下载。 当用户点击按钮下载PDF文件时。

0 个答案:

没有答案
相关问题