Skip to content

Instantly share code, notes, and snippets.

@tlxue
Last active August 29, 2015 13:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save tlxue/10479561 to your computer and use it in GitHub Desktop.
Save tlxue/10479561 to your computer and use it in GitHub Desktop.
Generate a qrcode from current page's link.
javascript:(function(){document.location.href='https://chart.googleapis.com/chart?chs=150x150&cht=qr&choe=UTF-8&chl='+encodeURIComponent(document.location.href);})()
// 根据当前页面生成 QR code 的 bookmarklet
// 用到了 Google Chart API: https://developers.google.com/chart/infographics/docs/qr_codes?csw=1
@NemoAlex
Copy link

感觉使用 window.open 会比较好

javascript:(function(){open('https://chart.googleapis.com/chart?chs=150x150&cht=qr&choe=UTF-8&chl='+encodeURIComponent(document.location.href));})()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment