Skip to content

Instantly share code, notes, and snippets.

@xantus
Created August 18, 2010 02:10
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 xantus/533107 to your computer and use it in GitHub Desktop.
Save xantus/533107 to your computer and use it in GitHub Desktop.
<script>
// create a QR code to this page's href using google's chart api
// positioned in the right corner. click to enlarge. click again to hide
// http://googlecode.blogspot.com/2008/07/qr-codes-now-available-on-google-chart.html
document.write([
'<img src="http://chart.apis.google.com/chart?chs=150x150&cht=qr&choe=UTF-8&chld=L|1&chl=',
encodeURIComponent(window.location.href),
'" width="35" height="35" alt="QR Code" title="Click Me!" ',
'style="position:absolute;top:10px;right:10px;" ',
'onclick="if(this.width==35){this.width=this.height=150;}else{this.style.display=\'none\';}"/>'
].join(''));
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment