Spaces:
Running
Running
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<script src="http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> | |
<script src="http://static.runoob.com/assets/qrcode/qrcode.min.js"></script> | |
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> | |
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
<script type="text/javascript" src="../js/util.js"></script> | |
<script type="text/javascript" src="../js/cx.js"></script> | |
</head> | |
<body> | |
<input id="text" type="text" placeholder="请输入需要生成的二维码内容..." style="width:50%" /> | |
<br /> | |
<div id="畅心"></div> | |
<hr> | |
<div class="btn-group"> | |
<button type="button" class="btn btn-primary" onclick="onbuttonclick('fn')">A1写入常量</button> | |
<button type="button" class="btn btn-primary" onclick="onbuttonclick('fb')">交互写入斐波那契数列指定项</button> | |
<button type="button" class="btn btn-primary" onclick="onbuttonclick('fn2')">将网页内容写入WPS客户端</button> | |
<button type="button" class="btn btn-primary" onclick="fn3()">将WPS客户端数据写入网页</button> | |
</div> | |
<p id="wps-data">测试引用wps客户端数据</p> | |
<script> | |
var qrcode = new QRCode(document.getElementById("畅心"), {width : 200,height : 200}); | |
function makeCode () { | |
var x= $("#text").val(); | |
qrcode.makeCode(x); | |
let curSheet = wps.EtApplication().ActiveSheet; | |
curSheet.Cells.Item(1, 1).Formula="执一以为天下式!" + curSheet.Cells.Item(1, 1).Formula | |
} | |
$("#text").on("blur", function () {makeCode();}).on("keydown", function (e) {if (e.keyCode == 13) {makeCode();}}); | |
function fn3(){ | |
let ash = wps.EtApplication().ActiveSheet; | |
$("#wps-data").text(ash.Cells.Item(1, 1).Value()) | |
} | |
</script> | |
</body> | |
</html> |