[查看演示] 源码如下 ---------------------------------------------------------- <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>转换源代码-www.51windows.Net</title>
<style>
body,td,div,a,input,textarea{font:menu}
</style>
</head>
<body>
<textarea style="width:500;height:200;font:menu" name="n1">
例子:
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</html>
</textarea><br>
<input type="button" onclick="txt=document.all.n1.value;hh()" value="转换" style="font:menu">
<script>
txt="";txt2="";txt3="";num=0
function hh(){
document.all.n1.value=Math.floor(num/txt.length*100)+"%"
txt3=txt.charAt(num)
if(txt3 == " "){txt3=" "};if(txt3 == "&"){txt3="&"};if(txt3 == "\""){txt3="""};if(txt3 == "<"){txt3="<"};if(txt3 == ">"){txt3=">"}
txt2=txt2+txt3
num++;if(num != txt.length){setTimeout("hh()",1)};else{document.all.n1.value=txt2}
}
</script>
</body>
</html>
<div style="position: absolute; top: 10; right: 10; width: 148; height: 18;cursor:hand">
<input type="button" name="Button" value="查看源代码" onClick= 'window.location = "view-source:" + window.location.href'></div> |