javascript动态生成网址二维码图片

这个实现二维码生成功能的是引用谷歌google的JS来实现的,可以兼容几乎所有浏览器,包括动态和静态网页,具有加载速度快的特点!
代码如下: 放到你想添加二维码的位置 ;
<script type="text/javascript" xml="space">// <![CDATA[
thisURL = document.URL;
strwrite =
"<img src='https://chart.googleapis.com/chart?cht=qr&chs=150x150&choe=UTF-8&chld=L|4&chl=" + thisURL + "' width='150' height='150' alt='网址URL 二维码生成' />";
document.write(strwrite);
// ]]></script>

猜你喜欢

转载自blog.csdn.net/leeningfeng/article/details/79381649
今日推荐