代码改变世界

js在线生成二维码

2019-10-22 23:02  写代码的渔夫  阅读(898)  评论(0)    收藏  举报

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>预览</title>
<script src="/js/jquery.min.js"></script>
<script src="/js/jquery.qrcode.min.js"></script> <style>
.topicsCode{
width: 255px;
height: 255px;
text-Align:center;
}
.topicsCode{
position: absolute;
top: 20%;
left: 39.5%;
}
#qrcode{
margin: 0;
padding: 0;
}
.prompt{
margin-top:5px;
font-size:15px;
}
</style>
</head>
<body>

<div class="topicsCode">
<div id="qrcode"></div>
<p class="prompt">请扫描二维码在手机端预览</p>
</div>
<script>
$(function(){
$('#qrcode').qrcode('http://www.baidu.com/');
})
</script>
</body>
</html>