Js To Html

<html><head><style>
 body{margin:0}
 textarea{width:760;height:180;font-size:9pt;font-family:Courier New;color:#666666}</style>
 <title>hao123网址之家---html转换成js</title>
<style type="text/css">
<!--

td,body {  font-size: 9pt}

a:link{ color:#000000; text-decoration:none}    

a:visited{COLOR: #000000; TEXT-DECORATION: none}

a:active{color:green;text-decoration:none}

a:hover{color:red;text-decoration:underline} body {
 margin-left: 0px;
 margin-top: 0px;
 margin-right: 0px;
}
.f9 {font-size: 12px;}
#sfont a,#sfont b{font-size:13px;}
.f9pt{font-size: 12px;}
-->

</style><base target="_blank">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">
  <center>
<p><a href="htmtojs.htm" target="_self">JS转HTML</a>&nbsp;&nbsp;<font color="#FF0000">HTML转JS</font></p>
</center>

 


  请将HTML源代码拷贝到下面表单中: <br>
  <textarea id="oSource" onpropertychange="change()" ></textarea>
  <br><br>
  下面表单中是相应的JS代码: <br />
  <textarea cols="100" id="oResult" title="双击复制" ondblclick='this.select();oResult.createTextRange().execCommand("Copy")'></textarea>  </textarea>
  <br>
  <script>
 function change(){
 oResult.value="document.writeln(\""+oSource.value.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\'/g,"\\\'").replace(/\"/g,"\\\"").split('\r\n').join("\");\ndocument.writeln(\"")+"\")"
 } </script>
</div>
</div>
</body></html>
<script language=javascript defer>
<!--
document.form1.wd.focus()
//-->
</script>

posted @ 2009-05-21 16:30  funnyzak  阅读(226)  评论(0编辑  收藏  举报