Skip to content

Instantly share code, notes, and snippets.

@cnDelbert
Last active August 29, 2015 14:12
Show Gist options
  • Save cnDelbert/64623ffae8d6462c37d2 to your computer and use it in GitHub Desktop.
Save cnDelbert/64623ffae8d6462c37d2 to your computer and use it in GitHub Desktop.
Click the bookmark to generate the QrCode. Click on the image of the QrCode to destory it.
javascript:((function(){document.body.innerHTML=document.body.innerHTML+"<div%20id='MyQrCode'%20style='display:block;z-index:99999;position:fixed;top:0;right:0;'%20onclick='javascript:(function(){var%20MyQrCode=document.getElementById(&quot;MyQrCode&quot;);MyQrCode.parentNode.removeChild(MyQrCode);}())'><img%20src='http://png.2vma.theucd.com/chart?chl="+escape(document.location.href)+"&chs=200x200&cht=qr&chld=%7C1&choe=UTF-8'></div>";})());
javascript:((function(){document.body.innerHTML=document.body.innerHTML+"<div%20id='MyQrCode'%20style='display:block;z-index:99999;position:fixed;top:0;right:0;'%20onclick='javascript:(function(){var%20MyQrCode=document.getElementById(&quot;MyQrCode&quot;);MyQrCode.parentNode.removeChild(MyQrCode);}())'><img%20src='http://chart.googleapis.com/chart?chl="+escape(document.location.href)+"&chs=200x200&cht=qr&chld=%7C1&choe=UTF-8'></div>";})());
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>二维码</title>
</head>
<body><p>将→ <a href="javascript:(function(){var%20d=document.createElement('div');var%20i=document.createElement('img');var%20b=document.getElementsByTagName('body')[0];d.appendChild(i);b.appendChild(d);i.src='http://png.2vma.theucd.com/chart?chl='+encodeURIComponent(document.location.href)+'&chs=200x200&cht=qr&chld=%7C1&choe=UTF-8';d.id='ATempQrCode';d.setAttribute('style','display:block;z-index:99999;position:fixed;top:0;right:0;');d.innerHTML=d.innerHTML+'<p>&copy;2015%20Created%20by%20<a%20href=&quot;http://delbert.me&quot;>Delbert</a></p>';d.onclick=function(){var%20myqrcode=document.getElementById('ATempQrCode');myqrcode.parentNode.removeChild(myqrcode);}}());"/>QrCode</a> ←拖动到收藏夹栏</p>
<p>用法: 点击书签生成当前网址的QrCode,点击生成的QrCode消失。</p>
<p>Gist: <a href="https://gist.github.com/cnDelbert/64623ffae8d6462c37d2">https://gist.github.com/cnDelbert/64623ffae8d6462c37d2</a></p>
</body>
</html>
<!-- // 1st Edition Compressed
javascript:((function(){document.body.innerHTML=document.body.innerHTML+"<div%20id='MyQrCode'%20style='display:block;z-index:99999;position:fixed;top:0;right:0;'%20onclick='javascript:(function(){var%20MyQrCode=document.getElementById(&quot;MyQrCode&quot;);MyQrCode.parentNode.removeChild(MyQrCode);}())'><img%20src='http://png.2vma.theucd.com/chart?chl="+escape(document.location.href)+"&chs=200x200&cht=qr&chld=%7C1&choe=UTF-8'></div>";})());
-->
<!-- // 2nd Edition
javascript:(function(){
var%20d=document.createElement('div');
var%20i=document.createElement('img');
var%20b=document.getElementsByTagName('body')[0];
d.appendChild(i);
b.appendChild(d);
i.src='http://png.2vma.theucd.com/chart?chl='+encodeURIComponent(document.location.href)+'&chs=200x200&cht=qr&chld=%7C1&choe=UTF-8';
d.id='ATempQrCode';
d.setAttribute('style','display:block;z-index:99999;position:fixed;top:0;right:0;');
//d.style='display:block;z-index:99999;position:fixed;top:0;right:0;';
d.innerHTML=d.innerHTML+'<p>&copy;2015%20Created%20by%20<a%20href=&quot;http://delbert.me&quot;>Delbert</a></p>';
d.onclick=function(){var%20myqrcode=document.getElementById(&quot;ATempQrCode&quot;);myqrcode.parentNode.removeChild(myqrcode);};
}());
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment