博客园  :: 首页  :: 新随笔  :: 联系 :: 管理

HTML代码转换为ASP代码

Posted on 2008-12-17 23:31  codingsilence  阅读(406)  评论(0编辑  收藏  举报

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>HTML代码转换为ASP代码</TITLE>
</HEAD>
<BODY>
<p align="center">
<font style="color:#FF0000; font-size:14px; font-weight:bolder">
HTML代码转换为ASP代码
</font>
</p>
<DIV align=center>
<TABLE width=760 border=0 align=center cellPadding=0 cellSpacing=0 background="" bgcolor="#FFFFFF" style="BORDER-RIGHT: #D9D9D9 1px solid; BORDER-TOP: #d9d9d9 1px solid; BORDER-LEFT: #D9D9D9 1px solid; WIDTH: 760px; COLOR: #ffffff; BORDER-BOTTOM: #D9D9D9 1px solid; HEIGHT: 21px">
  <SCRIPT>

function htmlphp(){
 var input = document.htphp.input.value;
 output = "Response.Write /"";
 for (var c = 0; c < input.length; c++){
  if ((input.charAt(c) == "/n" || input.charAt(c) == "/r")){
   output += "/" & vbCrLf";
   if (c != input.length - 1) output +="/n  Response.Write /"";
   c++;
   }
  else {
   if (input.charAt(c) == "/");") {
    output += "///"";
    }
   else {
    if (input.charAt(c) == "//"){
     output += "////";
     }

    else {
     output += input.charAt(c);
     if (c == input.length -1) output += "/" & vbCrLf"; 
     }
    }
   }
  
  }

 

 


info2="/n Response.Write /"/"/n" +

"/%/>";

 document.htphp.output.value =output+info2;
}

</SCRIPT>

  <TBODY>
  <TR>
    <TD>
      <P align=center>
      <TABLE borderColor=blue cellSpacing=0 cellPadding=0 width="100%"
        border=0><TBODY>
        <TR>
          <TD>
            <TABLE width="100%"
            border=0 cellPadding=0 cellSpacing=0 bgcolor="#F7F7F7">
              <TBODY>
              <TR>
                <TD align=middle>
                  <CENTER>
                  <FORM name=htphp>
                  <TABLE cellSpacing=2 cellPadding=2 width="100%" border=0>
                    <TBODY>
                    <TR>
                      <TD align=middle>上框内粘贴 HTML 代码</TD></TR></TBODY></TABLE>
                    <TBODY>
                    <TR>
                      <TD align=middle><TEXTAREA name=input rows=15 wrap=VIRTUAL cols=68></TEXTAREA>
                      </TD></TR>
                    <TR>
                      <TD align=middle><BR><FONT class=content>下框显示&nbsp;ASP
                        代码</FONT></TD></TR>
                    <TR>
                      <TD align=middle><TEXTAREA name=output rows=15 wrap=VIRTUAL cols=68></TEXTAREA>
                      </TD></TR>
                    <TR>
                      <TD align=middle><INPUT class=button onclick=htmlphp() type=button value=转换>
<INPUT class=button onclick=javascript:this.form.output.focus();this.form.output.select(); type=button value=全选 name=button wszystko>
<INPUT class=button onclick=reset(input.output) type=button value=清除>
<input onclick='output.select();document.execCommand("Copy")' type=button value=复制>
                      </TD></TR></FORM></CENTER></TD></TR>
                  <TR></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
</TD></TR></TBODY></TABLE></DIV>
</BODY>
</HTML>