|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>title</title>
<link rel="stylesheet" type="text/css" href="../css/api.css"/>
<style>
body {
}
html, body {
height: 100%
}
body {
background-color: #fff;
margin: 0;
}
#wrap {
height: 100%;
position: relative;
}
#header {
padding-top: 20px;
background-color: #5082c2;
height: 44px;
position: relative;
}
#header h1 {
font-size: 20px;
height: 44px;
line-height: 44px;
margin: 0em;
color: #fff;
margin-left: 100px;
margin-right: 100px;
text-align: center;
}
#main {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
}
a.button {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
-webkit-box-align: center;
height: 32px;
margin: 8px;
background-color: rgba(240,240,240,1.0);
border-color: rgba(220,220,220,1.0);
border-width: 2px;
border-style: solid;
}
a.active {
background-color: rgba(240,240,240,0.7);
}
</style>
</head>
<body>
<input type="text" id="text" />
<a class="button" tapmode="active">生成二维码</a>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
apiready = function() {
}
function a() {
var FNScanner = api.require('FNScanner');
FNScanner.encodeImg({
//type : 'qr_image',
content : '12345678',
saveToAlbum : true,
saveImg : {
path : 'fs://a.png',
w : 200,
h : 200
}
}, function(ret, err) {
if (ret.status) {
alert(JSON.stringify(ret));
} else {
alert(JSON.stringify(err));
}
});
}
</script>
</html>
请问怎样利用输入框替代上面的固定数字12345678 谢谢大家!查阅了一些资料没搞出来,特来求助
|
|