薅伙伴为所有人免费提供链接转二维码服务。可在下方直接体验:
1.在输入框输入您想转换的链接或文字。
2.点击生成按钮。
3.保存二维码图片或直接截屏。
//二维码内容 var txtContent = document.getElementById("txtContent"), tips = $("#tips");
// 设置 qrcode 参数 var qrcode = new QRCode('qrcode', { text: 'https://www.hhblm.com/', width: 256, height: 256, colorDark: '#000000', colorLight: '#ffffff', correctLevel: QRCode.CorrectLevel.H });
//生成二维码图像
function f_onCreateQrcode() {
if (!txtContent) {
return false;
} else {
if (!txtContent.value) {
tips.html("
!小伙伴要先填写二维码内容再提交生成哦");
} else {
// 使用 API
qrcode.clear();
tips.empty();
qrcode.makeCode(txtContent.value);
}
return false;
}
}
//清除二维码内容 function f_onClearQrcode() { if (txtContent) { txtContent.value = ""; // 使用 API qrcode.clear(); qrcode.makeCode('https://www.hhblm.com/'); } }