07-12
05
"运行此代码"的代码
作者:Java伴侣 日期:2007-12-05
复制内容到剪贴板 程序代码
<script language=Jscript>
function run(obj){
if (f1.code.value==''||f1.code.value==' '){alert("您需要运行的代码为空!");obj.focus()}
else{var winEx = window.open("", "winEx", "width=400,height=300,resizable=yes,top=0,left=0");
winEx.document.write(f1.code.value);winEx.document.close()}}
</script>
<style>body{color:#063;font-family:arial;font-size:12}
textarea{border:1 solid #000;font-family:arial;font-size:12;width:100%;color:red;margin:5 0}
</style>
<form name=f1>
<textarea name=code rows="20">Input Code ...</textarea>
<input type=button value=运行代码 onclick=run(code)>
</form>
function run(obj){
if (f1.code.value==''||f1.code.value==' '){alert("您需要运行的代码为空!");obj.focus()}
else{var winEx = window.open("", "winEx", "width=400,height=300,resizable=yes,top=0,left=0");
winEx.document.write(f1.code.value);winEx.document.close()}}
</script>
<style>body{color:#063;font-family:arial;font-size:12}
textarea{border:1 solid #000;font-family:arial;font-size:12;width:100%;color:red;margin:5 0}
</style>
<form name=f1>
<textarea name=code rows="20">Input Code ...</textarea>
<input type=button value=运行代码 onclick=run(code)>
</form>
评论: 0 | 引用: 0 | 查看次数: 1109
发表评论