2025年二维码生成器和二维码分享

二维码生成器和二维码分享

大家好,我是讯享网,很高兴认识大家。
<html>
<head>
	<title>二维码生成器-</title>
</head>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
<script type="text/javascript" src="http://static.runoob.com/assets/jquery/2.0.3/jquery.min.js"></script>
<script type="text/javascript" src="http://static.runoob.com/assets/qrcode/qrcode.min.js"></script>
<body>
<input id="text" type="text" value="666" style="width:80%" /><br />
<div id="qrcode" style="width:100px; height:100px; margin-top:15px;"></div>

<script type="text/javascript">
var qrcode = new QRCode(document.getElementById("qrcode"), {
	width : 100,
	height : 100
});

function makeCode () {		
	var elText = document.getElementById("text");
	
	if (!elText.value) {
		alert("Input a text");
		elText.focus();
		return;
	}
	
	qrcode.makeCode(elText.value);
}

makeCode();

$("#text").
	on("blur", function () {
		makeCode();
	}).
	on("keydown", function (e) {
		if (e.keyCode == 13) {
			makeCode();
		}
	});
</script>
</body>
</html>

讯享网

二维码生成器:http://codepen.io/dddddd1/pen/YpXxPX

------------------------------------------------二维码分享--------------------------------------------------

讯享网<!DOCTYPE html>
<html>
<head>
    <title>当前网站生成二维码</title>
    <meta charset="utf-8" />
</head>


<body>
<div id="qrcodeCanvas"></div>
</body>
<script type="text/javascript" src="https://static.runoob.com/assets/jquery/2.0.3/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    var url = window.location.href;
    console.log(url);
    jQuery('#qrcodeCanvas').qrcode({
        text    : url,
        width : 105,
        height : 105
    });  
})
</script>
</html>
-二维码分享:

https://codepen.io/dddddd1/pen/oGMBPv


讯享网

扫出来就是当前网址

参考:https://www.helloweba.com/view-blog-226.html

小讯
上一篇 2025-01-26 15:12
下一篇 2025-02-17 21:58

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/112773.html