网页自动生成二维码代码:
<script type="text/javascript"> 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>
网页自动生成二维码,原始生成二维码图片大小为宽度为150px,高度为150px。 只需要在需要显示地方放入二维码JS代码即可,打开网页即可显示。 本二维码生成使用是google谷歌JS,加载快速、兼容所有浏览器、兼容动态网页、静态html网页。
由于国内对google的屏蔽严重,导致了。上面的API使用不了了。解决办法下面的地址。
<script type="text/javascript"> thisURL = document.URL; strwrite = "<img src='http://2ma.io/Qr/api.2ma?resamplingx=180&resamplingy=180&text=" + thisURL + "' alt='手机扫一扫带走' />"; document.write( strwrite ); </script>