homepage/source/qr/index.html.slim

25 lines
881 B
Plaintext

== javascript_include_tag "qrcode.js"
== javascript_include_tag "html5-qrcode.js"
h1
| QRCode Generator Example
form#QRform.pure-form name="QRform"
textarea cols="50" name="textField" onclick="this.focus();this.select();" onkeyup="updateQRCode(this.value)" rows="8" I love QR Codes. Type in here and watch the QR code below update.
// This is where our QRCode will appear in.
#qrcode
javascript:
function updateQRCode(text) {
var element = document.getElementById("qrcode");
var bodyElement = document.body;
if(element.lastChild)
element.replaceChild(showQRCode(text), element.lastChild);
else
element.appendChild(showQRCode(text));
}
updateQRCode('I love QR Codes. Type in here and watch the QR code below update.');
p
a href="https://github.com/amanuel/JS-HTML5-QRCode-Generator" onmouseover="updateQRCode(this.href)" Project Homepage