1 Star 0 Fork 0

hunkier / hunkier

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
test.html 850 Bytes
一键复制 编辑 原始数据 按行查看 历史
hunkier 提交于 2022-07-31 22:51 . update
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
<script language="javascript">
//1.js 调用 iOS 原生扫码
function qrcodeClick() {
// 扫码成功后回调函数名,与下面的 iOS 向 js 传值函数名保持一致
let qrCodeCallbackMeth = 'qrcodeCallback';
window.webkit.messageHandlers.QRCode.postMessage(qrCodeCallbackMeth);
}
//2. iOS 向 js 传值
function qrcodeCallback(result) {
document.getElementById('qrcodeResult').value = result;
}
</script>
</head>
<body>
<h1>html5</h1>
<h1>调用扫码</h1>
<input type="button" value="扫码" onclick="qrcodeClick()"/>
<h1>展示扫码结果</h1>
<textarea id="qrcodeResult" type="value" rows="5" cols="40"> </textarea>
</body>
</html>
1
https://gitee.com/hunkier/hunkier.git
git@gitee.com:hunkier/hunkier.git
hunkier
hunkier
hunkier
master

搜索帮助