手机网页扫二维码
测试地址
http://39.106.12.24/DecodeQRCode
实时扫描的以现在的网络安全性确实实现不了,
这种是拍照后解码的
//qrcode.js 比较特别,要到我的服务器上下
//http://39.106.12.24/1Test/qrcode.js
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
<script src="qrcode.js" type="text/javascript" charset="utf-8"></script>
<script src="analyticCode.js" type="text/javascript" charset="utf-8"></script>
<style type="text/css">
#file {
position: absolute;
width: 120px;
height: 120px;
opacity: 0;
top: 0;
left: 0;
overflow: hidden;
z-index: 10;
}
</style>
</head>
<body>
<div class="module-content">
<div class="box">
<div style="position: relative;">
<img style="width: 120px;height: 120px;" src="" />
<input type="file" onchange="getUrl(this,'file-url')" name="" id="file" value="" />
<p class="url-box" id="urlBox"></p>
</div>
</div>
</div>
<script type="text/javascript">
function getUrl(e, param) {
analyticCode.getUrl(param, e, function (text, address) {
e.nextElementSibling.innerHTML = text;
e.previousElementSibling.src = address;
});
}
</script>
</body>
</html>