二维码

可以用javascript直接生成二维码
https://github.com/davidshimjs/qrcodejs
其实可以不用jquery,这样写比较简单

<html>
<head>
<title>QRCode</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="qrcode.min.js"></script>
</head>
<body>
<div id="qrcode" style="width:100px; height:100px; margin-top:15px;"></div>
<script type="text/javascript">
var qrcode = new QRCode(document.getElementById("qrcode"), {
    text: "http://mikuq.com",
    width: 128,
    height: 128,
    colorDark : "#000000",
    colorLight : "#eeeeee",
    correctLevel : QRCode.CorrectLevel.M
});
</script>
</body>

mikuq.png

再来看看服务端生成二维码

标签: none

添加新评论