<head>
<title>Cross-Browser QRCode generator for Javascript</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="qrcode.js"></script>
<script>
function nan()
{
var random=Math.ceil((Math.random() * 100000)+1)
document.frm1.nansu.value=random
makeCode();
}
</script>
</head>
<body>
<form name="frm1">
<input id="QRQR" type="text" name="nansu" readonly/> <input type="button" value="nansu" onclick="nan()"><br />
</form>
<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("QRQR");
qrcode.makeCode(elText.value);
}
makeCode();
$("#text").
on("blur", function () {
makeCode();
}).
on("keydown", function (e) {
if (e.keyCode == 13) {
makeCode();
}
});
</script>
</body>
여기<input id="QRQR" type="text" name="nansu" readonly/> 이코드 지워버리고 링크로 넣어줄려고하ㄴ는데
원래 var qrcode = new QRCode(document.getElementById("qrcode"), {
width : 100,
height : 100
}); 여기 안에 text값이 들어가야되는데 안들어가고
var elText = document.getElementById("QRQR");
qrcode.makeCode(elText.value);
}
여기값에 링크를 걸어주고싶은데
어떻게 해야될까여..?