Javascript 使用jquery从PHP到PDFconversion
我正在尝试使用jquery将表数据转换为pdf。它不起作用。当我单击按钮时,它不会转换。提交按钮似乎根本不起作用Javascript 使用jquery从PHP到PDFconversion,javascript,php,html,mysql,pdf-conversion,Javascript,Php,Html,Mysql,Pdf Conversion,我正在尝试使用jquery将表数据转换为pdf。它不起作用。当我单击按钮时,它不会转换。提交按钮似乎根本不起作用 <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="description" content="" />
<meta name="classification" content="" />
<title>Geochronology Asset Management System | Add Sample</title>
<!-- BOOTSTRAP CORE STYLE -->
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<script>
$(document).ready(function(e){
console.log("test")
$("#pdf1").click(function(e){
$("#tablepdf").tableExport({
type:'pdf',
escape:'false'
});
});
});
</script>
</head>
<body>
<h2>Export Data to pdf with PHP and MySQL</h2>
<button id="pdf1" class="btn btn-info">Export to pdf</button>
<table id="tablepdf" class="table table-striped table-bordered">
<tr>
<th>Name</th>
<th>Gender</th>
<th>Age</th>
<th>Designation</th>
<th>Address</th>
</tr>
<tr>
<th>Name</th>
<th>Gender</th>
<th>Age</th>
<th>Designation</th>
<th>Address</th>
</tr>
<tr>
<th>Name</th>
<th>Gender</th>
<th>Age</th>
<th>Designation</th>
<th>Address</th>
</tr>
<tr>
<th>Name</th>
<th>Gender</th>
<th>Age</th>
<th>Designation</th>
<th>Address</th>
</tr>
</table>
</div>
</body>
<!-- FOOTER SECTION END-->
<!-- JAVASCRIPT FILES PLACED AT THE BOTTOM TO REDUCE THE LOADING TIME -->
<!-- CORE JQUERY -->
<script src="assets/js/jquery-1.10.2.js"></script>
<script src="assets/js/tableExport.js"></script>
<script src="assets/js/jquery.base64.js"></script>
<!-- BOOTSTRAP SCRIPTS -->
<script src="assets/js/bootstrap.js"></script>
<!-- For PDF-->
<script src="assets/js/jspdf/jspdf.js"></script>
<script src="assets/js/jspdf/libs/sprintf.js"></script>
<script src="assets/js/jspdf/libs/base64.js"></script><!-- This templates was made by Colorlib (https://colorlib.com) -->
<!-- CUSTOM SCRIPTS -->
<script src="assets/js/custom.js"></script>
</html>
地质年代学资产管理系统|添加样本
$(文档).ready(函数(e){
控制台日志(“测试”)
$(“#pdf1”)。单击(函数(e){
$(“#tablepdf”).tableExport({
类型:'pdf',
逃避:'假'
});
});
});
使用PHP和MySQL将数据导出为pdf
导出为pdf
名称
性别
年龄
任命
地址
名称
性别
年龄
任命
地址
名称
性别
年龄
任命
地址
名称
性别
年龄
任命
地址
有人能告诉我我的代码有什么错误吗?我已经包含了所有库函数。库文件的顺序有什么问题吗???您遇到了什么错误console@AmanjotKaur它没有给出任何错误。但是按钮不工作无法转换为PDFAre您使用jspdf转换为pdf吗?如果是,请检查