• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • html->javascript->jsp(out.println())

    發表于:2007-06-21來源:作者:點擊數: 標簽:
    %@LANGUAGE= VB SCRIPT CODEPAGE=936% html head meta http-equiv=Content-Type content=text/html; charset=gb2312 titlehtml轉js轉jsp(或servlet)/title style type=text/css !-- body { font-size: 12px; text-align: center; margin: 0px; border: none;

       


    <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
    <html>
    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>html轉js轉jsp(或servlet)</title>
    <style type="text/css">
    <!--
    body {
    font-size: 12px;
    text-align: center;
    margin: 0px;
    border: none;
    background-color: #CCCCCC;
    }
    -->
    </style>
    </head>

    <body scroll=no>
    <script>
    function html2js(codestr){
    var codes=codestr.split("\n");
    var jscode="";
    var tcode="";
    for(var a=0;a<codes.length;a++){
    if(codes[a].replace(/\s+/,"")!=""){
    tcode="";
    tcode+=codes[a].replace(/\"/ig,"\\\\\\\"").replace(/(\s+)</ig,"<").replace(/\//ig,"\/");
    tcode="out.println(\"document.write(\\\""+tcode+"\\\");\");\n";
    jscode+=tcode.replace(/\r/ig,"");
    //alert(jscode);
    }
    }
    jscode="out.println(\"<script language=\\\"javascript\\\">\");\n"+jscode+"out.println(\"<\/script>\");";
    return jscode;
    }
    function runcode(){
    var mywin=window.open("","測試窗口","")
    mywin.document.open();
    mywin.document.write(jscode.value);
    mywin.document.close();
    }
    </script>
    <textarea name="htmlcode" style="width:100%" rows="15" id="htmlcode"></textarea>
    <input type="button" name="Submit" value=" 轉 換 " onClick="jscode.value=html2js(htmlcode.value)">
    <input type="button" name="Submit2" value=" 測 試 " onClick="runcode()">
    <br>
    <textarea name="jscode" style="width:100%" rows="15" id="jscode"></textarea>
    <br>
    </body>
    </html>

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>