<!DOCTYPE html> <html> <head> <title>QRcode</title> <style type="text/css"> .qrcodecenter{margin-left:auto;margin-right:auto;text-align:center} </style> <script> function updateQrcodeView() { var src = document.getElementById('qrcodeInputText').value; var qrcodeView = document.getElementById('qrcodeView'); qrcodeView.src = 'http://chart.apis.google.com/chart?chs=150x150&cht=qr&chl=' + encodeURIComponent(src); qrcodeView.style.visibility = 'visible'; var qrcodeText = document.getElementById('qrcodeText'); qrcodeText.innerText = src; } </script> </head> <body> <div class="qrcodecenter"> <input id="qrcodeInputText" type="text" size="40" placeholder="text here"> <input type="button" value="QRcode" onclick="javascript:updateQrcodeView();"> </div> <div class="qrcodecenter"> <image id="qrcodeView" style="visibility:hidden"> </div> <div id="qrcodeText" class="qrcodecenter"></div> </body> </html>
2011/01/08 01:18am ちょっと修正
0 件のコメント:
コメントを投稿