1:cocoscreator使用webview控件
webview.url = "https://blog.csdn.net"
// !这里设置百度的页面会报错
2:页面复制按钮的实现,参考:https://www.cnblogs.com/wisewrong/p/7473978.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<style type="text/css">
.wrapper {position: relative;}
#text {display: none;}
#input {position: absolute;top: 0;left: 0;opacity: 0;z-index: -10;}
</style>
<div class="wrapper">
<p id="text">test data abc</p>
<textarea id="input"></textarea>
<button onclick="copyText()">复制</button>
</div>
<script type="text/javascript">
function copyText() {
var text = document.getElementById("text").innerText;
var input = document.getElementById("input");
input.value = text; // 修改文本框的内容
input.select(); // 选中文本
document.execCommand("copy"); // 执行浏览器复制命令
alert("复制成功");
}
</script>
</body>
</html>