JS生成当前页面二维码
最近研究了怎么显示当前页面的二维码,使用JQuery的插件可以很简单地完成。
- 首先引用JQuery和生成二维码的插件
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://cdn.bootcss.com/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
- 页面中添加一个div作为生成二维码的容器
<div id="qrcode"></div>
- 使用以下JS生成
$("#qrcode").qrcode({
text: window.location.href, //设置字符串为当前url
width: 150,
height: 150
});
Categories
Tags
Jekyll(3)
Windows(1)
GitHub(4)
vs(4)
Portable(1)
hompage(1)
sitemap(1)
ruby(1)
gem(1)
qrcode(1)
jquery(1)
responsive(1)
Linux(6)
crontab(1)
sqlserver(4)
split(1)
backup(1)
js(1)
version(1)
csharp(2)
office(1)
com(1)
iis(1)
win8(1)
drag(1)
remote desktop(1)
Git GUI(1)
mail(1)
HTML(1)
table(1)
service(1)
32bit(1)
python(5)
pylesson(4)
volatile(1)
multithreading(1)
singleton(1)
webapi(2)
actionfilter(3)
filterprovider(1)