java生成二维码方法

xiaoxiao2021-02-28  56

一, jquery-qrcode方法(jsp页面写) 1,引入两个js           jquery-3.2.1.min.js           jquery.qrcode.min.js 2,创建web项目,在WebContent下创建js文件将上面两个复制到js下 3,相同路径下创建jsp文件夹,引入JavaScript,如下:     <%@ page language="java" contentType="text/html; charset=GB2312"        pageEncoding="GB2312"%>     <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">      <html>     <head>        <meta http-equiv="Content-Type" content="text/html; charset=GB2312">          <title>二维码</title>    </head>    <body>               <script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-3.2.1.min.js"></script>              <script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.qrcode.min.js"></script>           <div id="qrcode"></div>       <script type="text/javascript">             jQuery('#qrcode').qrcode({         width: 200,        height: 200, text : "http://baidu.com"  });     </script>    </body>     </html>
转载请注明原文地址: https://www.6miu.com/read-1699987.html

最新回复(0)