首页 > 编程知识 正文

代码生成二维码,url生成二维码

时间:2023-05-03 21:08:45 阅读:30571 作者:974

效果图表:

qrcode.js这是一个使用比较多的js生成二维码的插件,使用方便,第一次使用,记录使用方法;

首先,引入js。 这个可以在网上找到。 附上地址。 https://github.com/davidshimjs/QR code js /

jsp:

script type=' text/JavaScript ' src=' %=basepath % bootstrap/js/QR code.js ' charset=' utf-8 '/脚本输入类型-二维码弹出窗口--div class=' modal fade ' id=' my modal _ QR code ' tabindex='-1 ' role=' dialog ' aria-' class=' modal-header ' buttontype=' button ' class=' close ' data-dismiss=e '/span/button H4 class=' modal -。 divdivclass=' modal-body ' center divid=divtabletbodytrtdlabelclass=' col-sm-4 control-label ' for=' equ _ name labeldivclass=' col-sm-8 ' input class=' form-control ' id=' equ _ name _ QR code ' type=' text '/div/tdtdlabelclass=' col-sm-4控制- label ' for=' equ _ IP _ QR code ' H7设备IP:/h7/labeldivclass=' col-sm-8 ' input class=' form-control ' id=' equ _ IP _ QR code ' type=' text '/div/TD/TD divdivclass=' modal-footer ' buttontype=' button ' class=' BTN BTN-default ' data-dismiss=' modal ' span class=button buttontype=' button ' id=' BTN _ print ' class=' BTN BTN-primary ' data-dismiss=' modal ' span class=' glypp

//二维码对象var QR码; functionshowcode(id ) ) varrowid=$(#grid-table ).jqgrid )、) selrow ); (rowid!=null () varrowdata=$ ) ' #grid-table ' ).jqgrid('getrowdata ',rowid ); //获取内容$ () content ).val )公司名称) rowData.companyName )、)设备IP )、rowdata.deviceIP )、()搬入时间) rowdata.)。 $('#equ_name_qrcode ' ).val(rowdata.devicename ); $('#equ_ip_qrcode ' ).val(rowdata.deviceIP ); } else {toastr.error ('点击错误,请再次点击); 返回; (//上次的二维码if (QR代码) ) $ ) (QR代码) ).html ) ) ); //创建二维码QR代码=newq rcode (document.getelementbyid ) ' QR代码),{ width : 150,//宽height : 150 } ); $('#myModal_qrcode ' ).modal (; //$ ().BTN_print ) ).attr )、) BTN_print ) id ); QR code.makecode (document.getelementbyid (' content ' ).value ); }

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。