<!--引入jquery,jquery.qrcode 用于生成二维码的js-->
<script type='text/javascript'src='http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js'></script>
<script type="text/javascript"src="http://cdn.staticfile.org/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>

jsp代码

<div id = "qrid"></div>
<a target="_blank"  href="${activity.activityUrl}">点击跳转</a>
<input type="hidden" value="${activity.activityUrl}" id="activityUrl" />//后台数据库的网址连接
<script>
    $(function(){
        var activityId= document.getElementById("activityUrl").value;
        //$('#qrid').qrcode(qrstr);//不指定二维码大写 
        $('#qrid').qrcode({width: 280,height: 280,text: activityId});//指定二维码大小
    });
</script>

亲测 贴图

前端生成二维码(只需要网页地址即可)

 

相关文章:

  • 2021-12-09
  • 2022-01-21
  • 2021-06-03
  • 2022-12-23
  • 2021-12-26
  • 2021-12-27
  • 2022-12-23
猜你喜欢
  • 2021-08-24
  • 2022-01-01
  • 2021-12-09
  • 2021-12-15
  • 2021-12-09
  • 2021-06-13
相关资源
相似解决方案