第一种方法:
<img src="http://qrcoder.sinaapp.com?t=http://www.baidu.com" style="width:150px; height=150px;">
第二种方法:
首先引入:query.qrcode.min.js
其次,根据二维码所要显示的位置 (id=qrcode) 如下:
$("#qrcode").qrcode({
render: "table", //table方式
width: 120, //宽度
height:120, //高度
text: "http://www.baidu.com" //需要生成的url
});