非常简单的一个测试HTML代码的一个特效

王朝html/css/js·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

<html>

<head>

<title>www.knowsky.com</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<style>

input {border:1px solid #999999;background-color:white;height:18px}

</style>

<script>

function runEx(){

var winEx2 = window.open("", "winEx2", "width=500,height=300,status=yes,menubar=no,scrollbars=yes,resizable=yes"); winEx2.document.open("text/html", "replace");

winEx2.document.write(unescape(event.srcElement.parentElement.children[0].value));

winEx2.document.close();

}

function saveFile()

{

var win=window.open('','','top=10000,left=10000');

win.document.write(document.all.asdf.innerText)

win.document.execCommand('SaveAs','','e:\\knowsky\\test.htm')

win.close();

}

function paste()

{asdf.focus()

document.execCommand("Paste")}

</script>

</head>

<body bgcolor="#006699" text="#000000" scroll=auto onLoad="paste()">

<div align="center">

<p>

<textarea name="textfield" id="asdf" style="width:90%;background-color: black;border:'1px solid #999999';color:white;font-family:Verdana" rows="20" wrap="VIRTUAL">

</textarea>

<br>

<br>

<input type=button name=Button value=运行代码 onClick=runEx()>

<input type=button name=Button value=粘贴 onClick=paste()>

<input type=button name=Button value=全选 onClick=asdf.select()>

<input type=button name=Button value=清空 onClick="asdf.value=''">

<input type=button onClick="saveFile();" value='保存代碼'>

</div>

</body>

</html>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航