900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > js怎么实现对html代码加密解密 javascript脚本加密解密及HTML转JS

js怎么实现对html代码加密解密 javascript脚本加密解密及HTML转JS

时间:2019-04-08 05:34:07

相关推荐

js怎么实现对html代码加密解密 javascript脚本加密解密及HTML转JS

HTML

&

Javascript相互转换

<

body

>

HTML

&

Javascript输入

&

输出

<

br

>

<

script

>

functionchange()

...

{

code1.value="document.writeln(""+code0.value.replace(///g,"//").replace(///g,"//").replace(/'/g,"/'").replace(/"/g,"/"").split(' ').join(""); document.writeln("")+"");"}

functionrechange()

...

{

code2.value=code1.value.replace(/document.writeln("/g,"").replace(/");/g,"").replace(//"/g,""").replace(//'/g,"'").replace(g,"/").replace(g,"/")}

script

>

粘贴需要转换的HTML代码

<

br

>

<

textareaid

=

"

code0

"

rows

=

"

10

"

cols

=

"

120

"

onpropertychange

=

"

change();

"

>

textarea

>

<

br

>

粘贴需要转换的Javascript代码

<

br

>

<

textareaid

=

"

code1

"

rows

=

"

10

"

cols

=

"

120

"

onpropertychange

=

"

rechange();

"

>

textarea

>

<

br

>

由Javascript代码生成的HTML代码

<

br

>

<

textareaid

=

"

code2

"

rows

=

"

10

"

cols

=

"

120

"

>

textarea

>

body

>

escape

&

unescape加密

&

解密(可多次)

<

body

>

escape

&

unescape加密

&

解密

<

br

>

<

textareaid

=

"

code0

"

rows

=

"

16

"

cols

=

"

120

"

>

textarea

>

<

br

>

<

inputtype

=

"

button

"

value

=

"

加密

"

onclick

=

"

code1.value=escape(code0.value);

"

>

<

inputtype

=

"

button

"

value

=

"

解密

"

onclick

=

"

code1.value=unescape(code0.value);

"

>

<

inputtype

=

"

button

"

value

=

"

二次加密

"

onclick

=

"

code1.value=escape(escape(code0.value));

"

>

<

inputtype

=

"

button

"

value

=

"

二次解密

"

onclick

=

"

code1.value=unescape(unescape(code0.value));

"

>

<

inputtype

=

"

button

"

value

=

"

三次加密

"

onclick

=

"

code1.value=escape(escape(escape(code0.value)));

"

>

<

inputtype

=

"

button

"

value

=

"

三次解密

"

onclick

=

"

code1.value=unescape(unescape(unescape(code0.value)));

"

>

<

br

>

<

textareaid

=

"

code1

"

rows

=

"

16

"

cols

=

"

120

"

>

textarea

>

<

br

>

<

inputtype

=

"

button

"

value

=

"

加密

"

onclick

=

"

code1.value=escape(code1.value);

"

>

<

inputtype

=

"

button

"

value

=

"

解密

"

onclick

=

"

code1.value=unescape(code1.value);

"

>

<

inputtype

=

"

button

"

value

=

"

二次加密

"

onclick

=

"

code1.value=escape(escape(code1.value));

"

>

<

inputtype

=

"

button

"

value

=

"

二次解密

"

onclick

=

"

code1.value=unescape(unescape(code1.value));

"

>

<

inputtype

=

"

button

"

value

=

"

三次加密

"

onclick

=

"

code1.value=escape(escape(escape(code1.value)));

"

>

<

inputtype

=

"

button

"

value

=

"

三次解密

"

onclick

=

"

code1.value=unescape(unescape(unescape(code1.value)));

"

>

body

>

encode

&

decode加密

&

解密

<

body

>

encode

&

decode加密

&

解密

<

br

>

<

scriptlanguage

=

"

javascript

"

>

script

>

<

textareaid

=

"

code0

"

rows

=

"

16

"

cols

=

"

120

"

>

textarea

>

<

br

>

<

inputtype

=

"

button

"

value

=

"

加密

"

onclick

=

"

code1.value=screncode(code0.value,'JS');

"

>

<

inputtype

=

"

button

"

value

=

"

解密

"

onclick

=

"

code1.value=strdec(code0.value);

"

>

<

br

>

<

textareaid

=

"

code1

"

rows

=

"

16

"

cols

=

"

120

"

>

textarea

>

<

br

>

<

inputtype

=

"

button

"

value

=

"

加密

"

onclick

=

"

code1.value=screncode(code1.value,'JS');

"

>

<

inputtype

=

"

button

"

value

=

"

解密

"

onclick

=

"

code1.value=strdec(code1.value);

"

>

body

>

encodeURI

&

decodeURI加密

&

解密

<

body

>

encodeURI

&

decodeURI加密

&

解密

<

br

>

<

textareaid

=

"

code0

"

rows

=

"

16

"

cols

=

"

120

"

>

textarea

>

<

br

>

<

inputtype

=

"

button

"

value

=

"

加密

"

onclick

=

"

code1.value=encodeURI(code0.value);

"

>

<

inputtype

=

"

button

"

value

=

"

解密

"

onclick

=

"

code1.value=decodeURI(code0.value);

"

>

<

inputtype

=

"

button

"

value

=

"

二次加密

"

onclick

=

"

code1.value=encodeURI(encodeURI(code0.value));

"

>

<

inputtype

=

"

button

"

value

=

"

二次解密

"

onclick

=

"

code1.value=decodeURI(decodeURI(code0.value));

"

>

<

inputtype

=

"

button

"

value

=

"

三次加密

"

onclick

=

"

code1.value=encodeURI(encodeURI(encodeURI(code0.value)));

"

>

<

inputtype

=

"

button

"

value

=

"

三次解密

"

onclick

=

"

code1.value=decodeURI(decodeURI(decodeURI(code0.value)));

"

>

<

br

>

<

textareaid

=

"

code1

"

rows

=

"

16

"

cols

=

"

120

"

>

textarea

>

<

br

>

<

inputtype

=

"

button

"

value

=

"

加密

"

onclick

=

"

code1.value=encodeURI(code1.value);

"

>

<

inputtype

=

"

button

"

value

=

"

解密

"

onclick

=

"

code1.value=decodeURI(code1.value);

"

>

<

inputtype

=

"

button

"

value

=

"

二次加密

"

onclick

=

"

code1.value=encodeURI(encodeURI(code1.value));

"

>

<

inputtype

=

"

button

"

value

=

"

二次解密

"

onclick

=

"

code1.value=decodeURI(decodeURI(code1.value));

"

>

<

inputtype

=

"

button

"

value

=

"

三次加密

"

onclick

=

"

code1.value=encodeURI(encodeURI(encodeURI(code1.value)));

"

>

<

inputtype

=

"

button

"

value

=

"

三次解密

"

onclick

=

"

code1.value=decodeURI(decodeURI(decodeURI(code1.value)));

"

>

body

>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。