HTML and JS Interchange Tools _ Common Tools

Source: Internet
Author: User
Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
<meta http-equiv=content-type content= "text/html; charset=gb2312 ">
<link href= "Css.css" rel= "stylesheet" type= "Text/css" >
<meta content=html2js,js2html,html js,htmltojs,html Conversion js,html format conversion, HTML generation JS
Name=keywords>
<meta content= Cloud-dwelling community: www.jb51.net name= "Reterry (DXY)" >
<meta content= "MSHTML 6.00.2800.1226" Name=generator><style type= "Text/css" >
<!--
body,td,th {
font-size:12px;
Color: #333333;
}
-->
</style></HEAD>
<body leftmargin=0 topmargin=0>

<script language=javascript>
<!--
function Screncode (s,l)
{enc=new ActiveXObject ("Scripting.encoder");
Return ENC. Encodescriptfile (".") +l,s,0,l+ "Cript");
}


var state_copy_input = 100
var State_readlen = 101
var State_decode = 102
var state_unescape = 103

var pick_encoding = new Array (
1, 2, 0, 1, 2, 0, 2, 0, 0, 2, 0, 2, 1, 0, 2, 0,
1, 0, 2, 0, 1, 1, 2, 0, 0, 2, 1, 0, 2, 0, 0, 2,
1, 1, 0, 2, 0, 2, 0, 1, 0, 1, 1, 2, 0, 1, 0, 2,
1, 0, 2, 0, 1, 1, 2, 0, 0, 1, 1, 2, 0, 1, 0, 2
)

var rawdata = new Array (
0x64,0x37,0x69, 0x50,0x7e,0x2c, 0x22,0x5a,0x65, 0x4a,0x45,0x72,
0x61,0x3a,0x5b, 0x5e,0x79,0x66, 0x5d,0x59,0x75, 0x5b,0x27,0x4c,
0x42,0x76,0x45, 0x60,0x63,0x76, 0x23,0x62,0x2a, 0x65,0x4d,0x43,
0x5f,0x51,0x33, 0x7e,0x53,0x42, 0x4f,0x52,0x20, 0x52,0x20,0x63,
0X7A,0X26,0X4A, 0x21,0x54,0x5a, 0x46,0x71,0x38, 0x20,0x2b,0x79,
0x26,0x66,0x32, 0x63,0x2a,0x57, 0x2a,0x58,0x6c, 0x76,0x7f,0x2b,
0x47,0x7b,0x46, 0x25,0x30,0x52, 0x2c,0x31,0x4f, 0x29,0x6c,0x3d,
0X69,0X49,0X70, 0x3f,0x3f,0x3f, 0x27,0x78,0x7b, 0x3f,0x3f,0x3f,
0x67,0x5f,0x51, 0x3f,0x3f,0x3f, 0x62,0x29,0x7a, 0x41,0x24,0x7e,
0x5a,0x2f,0x3b, 0x66,0x39,0x47, 0x32,0x33,0x41, 0x73,0x6f,0x77,
0x4d,0x21,0x56, 0x43,0x75,0x5f, 0x71,0x28,0x26, 0x39,0x42,0x78,
0x7c,0x46,0x6e, 0x53,0x4a,0x64, 0x48,0x5c,0x74, 0x31,0x48,0x67,
0x72,0x36,0x7d, 0x6e,0x4b,0x68, 0x70,0x7d,0x35, 0x49,0x5d,0x22,
0x3f,0x6a,0x55, 0x4b,0x50,0x3a, 0x6a,0x69,0x60, 0x2e,0x23,0x6a,
0x7f,0x09,0x71, 0x28,0x70,0x6f, 0x35,0x65,0x49, 0x7d,0x74,0x5c,
0X24,0X2C,0X5D, 0x2d,0x77,0x27, 0x54,0x44,0x59, 0x37,0x3f,0x25,
0x7b,0x6d,0x7c, 0x3d,0x7c,0x23, 0x6c,0x43,0x6d, 0x34,0x38,0x28,
0x6d,0x5e,0x31, 0x4e,0x5b,0x39, 0x2b,0x6e,0x7f, 0x30,0x57,0x36,
0x6f,0x4c,0x54, 0x74,0x34,0x34, 0x6b,0x72,0x62, 0x4c,0x25,0x4e,
0x33,0x56,0x30, 0x56,0x73,0x5e, 0x3a,0x68,0x73, 0x78,0x55,0x09,
0X57,0X47,0X4B, 0x77,0x32,0x61, 0x3b,0x35,0x24, 0X44,0X2E,0X4D,
0x2f,0x64,0x6b, 0x59,0x4f,0x44, 0x45,0x3b,0x21, 0x5c,0x2d,0x37,
0x68,0x41,0x53, 0x36,0x61,0x58, 0x58,0x7a,0x48, 0x79,0x22,0x2e,
0x09,0x60,0x50, 0x75,0x6b,0x2d, 0x38,0x4e,0x29, 0x55,0x3d,0x3f
)

var transformed = new Array ()
for (var i=0 i<3; i++) transformed[i] = new Array ()
For (Var i=31. i<=126; i++) for (var j=0 j<3; j + +) transformed[j][rawdata[(i-31) * 3 + j]] = (i==31)? 9:i

var digits = new Array ()
for (var i=0; i<26; i++)
{
digits["A". charCodeAt (0) +i] = i
Digits["a". charCodeAt (0) +i] = i+26
}
for (var i=0 i<10; i++) digits["0". charCodeAt (0) +i] = i+52
DIGITS[0X2B] = 62
DIGITS[0X2F] = 63

function unescape (char)
{
var escapes = "#&!*$"
var escaped = "\r\n<>@"

if (char.charcodeat (0) > 126) return char
if (Escapes.indexof (char)!=-1) return Escaped.substr (Escapes.indexof (char), 1)
Return "?"
}

function DecodeBase64 (String)
{
var val = 0
Val + = (digits[string.substr (0,1). charCodeAt (0)] << 2)
Val + = (digits[string.substr (1,1). charCodeAt (0)] >> 4)
Val + = (digits[string.substr (1,1) charcodeat (0)] & 0xf) << 12
Val + = ((Digits[string.substr (2,1). charCodeAt (0)] >> 2) << 8)
Val + = ((Digits[string.substr (2,1). charCodeAt (0)] & 0x3) << 22)
Val + = (digits[string.substr (3,1). charCodeAt (0)] << 16)
Return Val
}

function Strdec (encodingstring)
{

var marker = "#@~^"
var StringIndex = 0
var scriptindex =-1
var unencodingindex = 0
var char = null
var encodinglength = Unencodinglength = 0
var state = State_copy_input
var unencodingstring = ""
var Re, arr

while (state)
{
Switch (state)
{
Case (State_copy_input):
Scriptindex = Encodingstring.indexof (marker, StringIndex)
if (Scriptindex!=-1)
{
Unencodingstring + + encodingstring.substring (StringIndex, Scriptindex)
Scriptindex + + Marker.length
State = State_readlen
}
Else
{
StringIndex = stringindex==0? 0:stringindex
Unencodingstring + + encodingstring.substr (StringIndex, Encodingstring.length)
State = 0
}
Break

Case (State_readlen):
Encodinglength = Encodingstring.substr (Scriptindex, 6)
Unencodinglength = DecodeBase64 (encodinglength)
Scriptindex + = (6 + "= =". Length)
State = State_decode
Break

Case (State_decode):
if (!unencodinglength)
{
StringIndex = Scriptindex + "dqgaaa==^#~@". Length
Unencodingindex = 0
State = State_copy_input
Break
}
char = Encodingstring.substr (Scriptindex, 1)
if (char = = "@") state = State_unescape
Else
{
if (char.charcodeat (0) < 0xFF)
{
Unencodingstring + + string.fromcharcode (transformed[pick_encoding[unencodingindex%64]][char.charcodeat (0)])
unencodingindex++
}
Else
{
unencodingstring = Char
}
scriptindex++
unencodinglength--
Break
}

Case State_unescape:
Unencodingstring + + unescape (encodingstring.substr (++scriptindex, 1))
scriptindex++; Unencodinglength-=2
unencodingindex++
State = State_decode
Break
}
}

Re = new RegExp ("jscript| VBscript). Encode "," GMI ")
while (arr = re.exec (unencodingstring)) unencodingstring = Regexp.leftcontext + regexp.$1 + regexp.rightcontext
Return unencodingstring
}

-->
</SCRIPT>

<div align= "center" >
</div>
<table width= "760" border= "0" align= "center" cellpadding= "0" cellspacing= "0" >
<tr>
&LT;TD valign= "Top" > <div align=center>
<table cellspacing=1 width=760 Align=center border=0>
<TBODY>
<TR>
&LT;TD width= "50%" > <div align=center></div>
&LT;HR width=760 size=1> </TD>
</TR>
<tr bgcolor= #ff9933 >
&LT;TD width= "50%" height= > <div align=center>js format into HTML format </DIV></TD>
</TR>
</TBODY>
</TABLE>
Please copy the JS source code to the following form: <BR>
<textarea name= "TEXTAREA" Id=oresult style= "border-right: #ffffff 2px solid; Border-top: #ffffff 2px solid; font-size:14px; BACKGROUND: #f6f6f6; Border-left: #ffffff 2px solid; width:700px; Border-bottom: #ffffff 2px solid; height:250px "title= double-click Copy ondblclick= ' This.select (); Oresult.createtextrange (). ExecCommand (" copy ") ' Onpropertychange=rechange () ></TEXTAREA>
<BR>
The following form is the corresponding HTML code: <BR>
<textarea name= "textarea2" Id=re style= "border-right: #ffffff 2px solid; Border-top: #ffffff 2px solid; font-size:14px; BACKGROUND: #f6f6f6; Border-left: #ffffff 2px solid; width:700px; Border-bottom: #ffffff 2px solid; height:250px "title= double-click Copy ondblclick= ' This.select (); This.createtextrange (). ExecCommand (" copy ") ' ></textarea >
<SCRIPT>
function Rechange () {
Re.value=oresult.value.replace (/document.write\ ("/g,"). Replace (/"\);/g," "). Replace (/\\\"/g, "\"). Replace (/\\\ '/g, ' \ '). Replace (/\\\//g, "\/"). Replace (/\\\\/g, "\ \")
}
</SCRIPT>
</DIV>
<TBODY>
<TR>
&LT;TD width= "50%" height= "> <div align=center>html format into JS format </DIV></TD>
</TR>
</TBODY>
</TABLE>
<div align=center> Please copy the HTML source code into the following form: <BR>
<textarea name= "textarea2" Id=osource style= "border-right: #ffffff 2px solid; Border-top: #ffffff 2px solid; font-size:14px; BACKGROUND: #f6f6f6; Border-left: #ffffff 2px solid; width:700px; Border-bottom: #ffffff 2px solid; height:250px "title= double-click Copy Onpropertychange=change () ></TEXTAREA>
<BR>
The following form is the corresponding JS code: <BR>
<textarea name= "textarea2" Id=oresult2 style= "border-right: #ffffff 2px solid; Border-top: #ffffff 2px solid; font-size:14px; BACKGROUND: #f6f6f6; Border-left: #ffffff 2px solid; width:700px; Border-bottom: #ffffff 2px solid; height:250px "title= double-click Copy ondblclick= ' This.select (); Oresult.createtextrange (). ExecCommand (" copy ") ' ></ Textarea>
<BR>
<SCRIPT>
function Change () {
Oresult2.value= "document.write (\" "+osource.value.replace (/\\/g," \\\\ "). Replace (/\//g," \\/"). Replace (/\ '/g," \\\ ' "). Replace (/\"/g, \\\ "). Split (' \ r \ n '). Join (" \ "); \ndocument.write (\" ") +" \ ");"
} </SCRIPT>
</DIV>
<P> </td>
</tr>
</table>
</BODY></HTML>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.