Skip to content

Instantly share code, notes, and snippets.

@gcollazo
Created March 8, 2014 18:36
Show Gist options
  • Save gcollazo/9436675 to your computer and use it in GitHub Desktop.
Save gcollazo/9436675 to your computer and use it in GitHub Desktop.
<html>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
'use strict';
var url = 'https://chart.googleapis.com/chart?cht=qr&chs=150x150&chld=H|0&chl=';
$(document).ready(function() {
$('#btn').click(function() {
var qrurl = url + $('#textField').val();
$('#image').attr('src', qrurl);
});
});
</script>
<p><input type="text" id="textField"></p>
<p><button id="btn">Generate</button></p>
<p><img id="image"></p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment