QR Codes How to Get link current page?

admin

Administrator
Staff member
Hello i'm new in programming need a little help to customize QR code script and want to use on my website.

what i want is automatic get link so edited below line and replace Input Text with

Code:
<input id="text" type="text" value="http://www.demo.com"/><br />

but i when i tried on wordpress site i gives input line i don't want that line just only QR code image of current link i think need to remove and replace something in this script
also tried to remove

Code:
<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>
<body>
<input id="text" type="text" value="<?php echo get_permalink(); ?>"/><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>