<script language="javascript" type="text/javascript"> function copycode(obj) { var rng = document.body.createTextRange(); var obj1=document.getElementById(obj) rng.moveToElementText(obj1); rng.scrollIntoView(); rng.select(); rng.execCommand("Copy"); rng.collapse(false); } function runCode(obj) { var winname = window.open('', "_blank", ''); var obj1=document.getElementById(obj) winname.document.open('text/html', 'replace'); winname.opener = null // 防止恶意修改 winname.document.writeln(obj1.value); winname.document.close(); } function saveCode(obj) { var winname = window.open('', '_blank', 'top=10000'); var obj1=document.getElementById(obj) winname.document.open('text/html', 'replace'); winname.document.writeln(obj1.value); winname.document.execCommand('saveas','','现代视觉创意联盟.htm'); winname.close(); } </script> <textarea cols="80" rows="20" name="code" class="code_texear"> </textarea> <div class="editbox"><input class="code_input" onclick="runCode('code')" type="button" value="运行代码" /> <input class="code_input" onclick="copycode('code')" type="button" value="复制代码" /> <input class="code_input" onclick="saveCode('code')" type="button" value="另存代码" /> <b>提示:您可以先修改部分代码再运行或者直接保存</b> </div> </div> |