<script language="javascript"> function runCode(obj) { var winname = window.open('', "_blank", ''); winname.document.open('text/html', 'replace'); winname.opener = null // 防止代码对论谈页面修改 winname.document.write(obj.value); winname.document.close(); } function saveCode(obj) { var winname = window.open('', '_blank', 'top=10000'); winname.document.open('text/html', 'replace'); winname.document.write(obj.value); winname.document.execCommand('saveas','','code.htm'); winname.close(); } function copycode(obj) { if(obj.style.display != 'none') { var rng = document.body.createTextRange(); rng.moveToElementText(obj); rng.scrollIntoView(); rng.select(); rng.execCommand("Copy"); rng.collapse(false); } } </script>
网页,运行代码,复制代码,代码另存的代码
最新推荐文章于 2024-04-26 11:22:00 发布