Skip to content

Instantly share code, notes, and snippets.

@ugeugeHigh
Created March 1, 2019 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ugeugeHigh/b347a62455081e0c6872de74256c3959 to your computer and use it in GitHub Desktop.
Save ugeugeHigh/b347a62455081e0c6872de74256c3959 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="jquery.qrcode.js"></script>
<script src="qrcode.js"></script>
<link href="css/style.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
$(function() {
var url;
$('#send').click(function () {
url = $('#text').val();
console.log(url);
if(url != '') {
$("canvas").remove();
$("#qrcode").html();
$("#qrcode").qrcode({text: url});
}
});
});
</script>
<title>QR code generator</title>
</head>
<body>
<header>
<h1 id="title">QR code generator</h1>
</header>
<div id="wrap">
<h3>generating QR codes</h3>
<form>
<input type="text" id="text">
<input type="button" value="send" id="send">
</form>
<div id="qrcode"></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment