nbsp;HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
代码转换器 <script> <BR>function paste() //粘帖 <BR>{ <BR> source.value=""; <BR> source.focus(); <BR> document.execCommand("paste"); <BR> if(source.value=="") <BR> alert("您的剪切板中似乎没有任何文本内容 ^_^"); <BR>} <BR>function make() //转换 <BR>{ <BR> if(source.value=="") <BR> { <BR> alert("文本框中没有任何代码哦 :("); <BR> source.focus(); <BR> return; <BR> } <BR> var code=source.value.replace(/^\s*/,"").replace(/\s*$/,"").split("\n"); <BR> result.value=""; <BR> var reop,rhop,stol,dnol; <BR> rhop = (rhh[0].checked)?"'":'"'; <BR> reop = (rhh[0].checked)?/([\'\\])/g:/([\"\\])/g; <BR> if(dww[0].checked) <BR> { <BR> stol = "document.writeln("; <BR> dnol =")"; <BR> } <BR> else <BR> { <BR> result.value+="var nin = "+rhop+"\\n"+rhop+";\n"; <BR> result.value+="var "+dname.value+" = "+rhop+rhop+";\n"; <BR> stol = dname.value+"+="; <BR> dnol ="+nin"; <BR> } <BR> for(var i=0; i<code.length; i++) <BR> result.value+=stol+rhop+code[i].replace(/\s*$/,"").replace(reop,"\\$1")+rhop+dnol+";\n"; <BR>} <BR>function copy() //复制 <BR>{ <BR> if(result.value=="") <BR> { <BR> alert("什么都没有,你要复制什么呢?"); <BR> return; <BR> } <BR> result.focus(); <BR> result.select(); <BR> document.execCommand("copy"); <BR>} <BR>function automake() //剪切板内容自动转换 <BR>{ <BR> paste(); <BR> if(source.value=="") <BR> return; <BR> make(); <BR> copy(); <BR> alert("OK!剪切板中的内容已转换完成!\n可以直接粘帖到你的文件中了。"); <BR>} <br><br></script>