杰克工作室 发表于 2023-2-23 20:20

jQuery生成带汉字的跳转连接二维码(附代码)

引入必要的JS文件:
<pre>
&lt;script src=&quot;/static/core/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;/static/core/jquery-qrcode-0.14.0.min.js&quot;&gt;&lt;/script&gt;</pre>
JS代码:

<pre>
var _href = &quot;https://iz7z8.net&quot;;
jQuery(&#39;#qrcode&#39;).qrcode({
   render: &quot;canvas&quot;,
   width: 200,
   height: 200,
   //render: &quot;table&quot;,
   text: _href,
   //src: &#39;http://province.hznt.com/public/static/admin/img/logo.png&#39;,
   background: &quot;#ffffff&quot;,

   mode: 2,
   mSize: 0.1,
   mPosX: 0.5,
   mPosY: 0.5,
   label: &#39;粤&#39;,
   fontname: &#39;sans&#39;,
   fontcolor: &#39;#f00&#39;,
});</pre>
效果:<br />
<img alt="" src="data/attachment/forum/202302/23/2023-02-23_20-20-24_889.png" />
页: [1]
查看完整版本: jQuery生成带汉字的跳转连接二维码(附代码)