当前位置: 必赢官网 > 操作系统 > 正文

有一个浏览器的关注批量点击插件因为停用了找

时间:2019-12-21 20:06来源:操作系统
一个js文件,很大,取了相关一部分,想把生成签名的逻辑解出来,然后用其它的语言做成自动化去读出数据E="function"===typeofSymbol"symbol"===typeofSymbol.iterator?function(e){returntypeofe}:function(e

一个js文件,很大,取了相关一部分,想把生成签名的逻辑解出来,然后用其它的语言做成自动化去读出数据E="function"===typeofSymbol"symbol"===typeofSymbol.iterator?function(e){returntypeofe}:function(e){returne"function"===typeofSymbole.constructor===Symbole!==Symbol.prototype?"symbol":typeofe},j=function(e){vart=arguments.length1void0!==arguments[1]?arguments[1]:"",n=t;return"object"===("undefined"===typeofe?"undefined":E(e))?Array.isArray(e)?JSON.stringify(e):(Object.keys(e).forEach(function(t){n =',"' t '":' e[t]}),"{" n.substr(1) "}"):JSON.stringify(e)},M=function(e,t){varn="";returnObject.keys(e).sort().forEach(function(t){"undefined"!==typeofe[t]""!==e[t]("object"===E(e[t])?n ="" t "=" j(e[t]):n ="" t "=" e[t])}),n=n.substr(1) t,i()(n)},varl=Object.assign({nonce:"7d373514-ef2f-4e2f-b436-f1876a7c9328",timestamp:"1548670214"},n);o.Sign=M(l,"75DCC830-6D4D2EFE-D3D98A52-3AF60F1C");最后得到的签名为:6570c7921ae5a4faa7a4ef3627b4ff8c问题:o.Sign生成的逻辑如果有信心的,可以加微信,发整个文件去分析,如果能解决,发红包酬谢

必赢官网 1

这几天,遇到了json格式在JS和Jquey的环境中,需要相互转换,在网上查了一下,大多为缺胳膊少腿,也许咱是菜鸟吧,终于测试成功后,还是给初学者们一个实例吧。

这是激活页面的图,上面提供了激活序列号,下面需要激活代码!!!解压crx后获得的代码页面:不知道是怎么计算的。求解。。(function(t){vare={};functionn(r){if(e[r])returne[r].exports;varo=e[r]={i:r,l:!1,exports:{}};returnt[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeofSymbolSymbol.toStringTagObject.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1e(t=n(t)),8e)returnt;if(4e"object"===typeofttt.__esModule)returnt;varr=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2e"string"!=typeoft)for(varoint)n.d(r,o,function(e){returnt[e]}.bind(null,o));returnr},n.n=function(t){vare=tt.__esModule?function(){returnt["default"]}:function(){returnt};returnn.d(e,"a",e),e},n.o=function(t,e){returnObject.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=0)})({0:function(t,e,n){t.exports=n("e588")},"01f9":function(t,e,n){"usestrict";varr=n("2d00"),o=n("5ca1"),i=n("2aba"),s=n("32e9"),a=n("84f2"),u=n("41a0"),c=n("7f20"),f=n("38fd"),l=n("2b4c")("iterator"),d=!([].keys"next"in[].keys()),h="@@iterator",p="keys",v="values",g=function(){returnthis};t.exports=function(t,e,n,y,m,b,x){u(n,e,y);var_,w,A,T=function(t){if(!dtinE)returnE[t];switch(t){casep:returnfunction(){returnnewn(this,t)};casev:returnfunction(){returnnewn(this,t)}}returnfunction(){returnnewn(this,t)}},C=e "Iterator",O=m==v,S=!1,E=t.prototype,k=E[l]||E[h]||mE[m],$=k||T(m),L=m?O?T("entries"):$:void0,j="Array"==eE.entries||k;if(j(A=f(j.call(newt)),A!==Object.prototypeA.next(c(A,C,!0),r||"function"==typeofA[l]||s(A,l,g))),Okk.name!==v(S=!0,$=function(){returnk.call(this)}),r!x||!d!SE[l]||s(E,l,$),a[e]=$,a[C]=g,m)if(_={values:O?$:T(v),keys:b?$:T(p),entries:L},x)for(win_)winE||i(E,w,_[w]);elseo(o.P o.F*(d||S),e,_);return_}},"02f4":function(t,e,n){varr=n("4588"),o=n("be13");t.exports=function(t){returnfunction(e,n){vari,s,a=String(o(e)),u=r(n),c=a.length;returnu0||u=c?t?"":void0:(i=a.charCodeAt(u),i55296||i56319||u 1===c||(s=a.charCodeAt(u 1))56320||s57343?t?a.charAt(u):i:t?a.slice(u,u 2):s-56320 (i-5529610) 65536)}}},"0390":function(t,e,n){"usestrict";varr=n("02f4")(!0);t.exports=function(t,e,n){returne (n?r(t,e).length:1)}},"044b":function(t,e){functionn(t){return!!t.constructor"function"===typeoft.constructor.isBuffert.constructor.isBuffer(t)}functionr(t){return"function"===typeoft.readFloatLE"function"===typeoft.slicen(t.slice(0,0))}/*!*DetermineifanobjectisaBuffer**@authorFerossAboukhadijeh*@licenseMIT*/t.exports=function(t){returnnull!=t(n(t)||r(t)||!!t._isBuffer)}},"097d":function(t,e,n){"usestrict";varr=n("5ca1"),o=n("8378"),i=n("7726"),s=n("ebd6"),a=n("bcaa");r(r.P r.R,"Promise",{finally:function(t){vare=s(this,o.Promise||i.Promise),n="function"==typeoft;returnthis.then(n?function(n){returna(e,t()).then(function(){returnn})}:t,n?function(n){returna(e,t()).then(function(){thrown})}:t)}})},"0a06":function(t,e,n){"usestrict";varr=n("2444"),o=n("c532"),i=n("f6b4"),s=n("5270");functiona(t){this.defaults=t,this.interceptors={request:newi,response:newi}}a.prototype.request=function(t){"string"===typeoft(t=o.merge({url:arguments[0]},arguments[1])),t=o.merge(r,{method:"get"},this.defaults,t),t.method=t.method.toLowerCase();vare=[s,void0],n=Promise.resolve(t);this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});while(e.length)n=n.then(e.shift(),e.shift());returnn},o.forEach(["delete","get","head","options"],function(t){a.prototype[t]=function(e,n){returnthis.request(o.merge(n||{},{method:t,url:e}))}}),o.forEach(["post","put","patch"],function(t){a.prototype[t]=function(e,n,r){returnthis.request(o.merge(r||{},{method:t,url:e,data:n}))}}),t.exports=a},"0a49":function(t,e,n){varr=n("9b43"),o=n("626a"),i=n("4bf8"),s=n("9def"),a=n("cd1c");t.exports=function(t,e){varn=1==t,u=2==t,c=3==t,f=4==t,l=6==t,d=5==t||l,h=e||a;returnfunction(e,a,p){for(varv,g,y=i(e),m=o(y),b=r(a,p,3),x=s(m.length),_=0,w=n?h(e,x):u?h(e,0):void0;x_;_ )if((d||_inm)(v=m[_],g=b(v,_,y),t))if(n)w[_]=g;elseif(g)switch(t){case3:return!0;case5:returnv;case6:return_;case2:w.push(v)}elseif(f)return!1;returnl?-1:c||f?f:w}}},"0bfb":function(t,e,n){"usestrict";varr=n("cb7c");t.exports=function(){vart=r(this),e="";returnt.global(e ="g"),t.ignoreCase(e ="i"),t.multiline(e ="m"),t.unicode(e ="u"),t.sticky(e ="y"),e}},"0d58":function(t,e,n){varr=n("ce10"),o=n("e11e");t.exports=Object.keys||function(t){returnr(t,o)}},"0df6":function(t,e,n){"usestrict";t.exports=function(t){returnfunction(e){returnt.apply(null,e)}}},1157:function(t,e,n){varr,o;/*!*jQueryJavaScriptLibraryv3.3.1***IncludesSizzle.js***CopyrightJSFoundationandothercontributors*ReleasedundertheMITlicense***Date:2018-01-20T17:24Z*//*!*jQueryJavaScriptLibraryv3.3.1***IncludesSizzle.js***CopyrightJSFoundationandothercontributors*ReleasedundertheMITlicense***Date:2018-01-20T17:24Z*/(function(e,n){"usestrict";"object"===typeoft.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)thrownewError("jQueryrequiresawindowwithadocument");returnn(t)}:n(e)})("undefined"!==typeofwindow?window:this,function(n,i){"usestrict";vars=[],a=n.document,u=Object.getPrototypeOf,c=s.slice,f=s.concat,l=s.push,d=s.indexOf,h={},p=h.toString,v=h.hasOwnProperty,g=v.toString,y=g.call(Object),m={},b=function(t){return"function"===typeoft"number"!==typeoft.nodeType},x=function(t){returnnull!=tt===t.window},_={type:!0,src:!0,noModule:!0};functionw(t,e,n){e=e||a;varr,o=e.createElement("script");if(o.text=t,n)for(rin_)n[r](o[r]=n[r]);e.head.appendChild(o).parentNode.removeChild(o)}functionA(t){returnnull==t?t "":"object"===typeoft||"function"===typeoft?h[p.call(t)]||"object":typeoft}varT="3.3.1",C=function(t,e){returnnewC.fn.init(t,e)},O=/^[suFEFFxA0] |[suFEFFxA0] $/g;functionS(t){vare=!!t"length"intt.length,n=A(t);return!b(t)!x(t)("array"===n||0===e||"number"===typeofee0e-1int)}C.fn=C.prototype={jquery:T,constructor:C,length:0,toArray:function(){returnc.call(this)},get:function(t){returnnull==t?c.call(this):t0?this[t this.length]:this[t]},pushStack:function(t){vare=C.merge(this.constructor(),t);returne.prevObject=this,e},each:function(t){returnC.each(this,t)},map:function(t){returnthis.pushStack(C.map(this,function(e,n){returnt.call(e,n,e)}))},slice:function(){returnthis.pushStack(c.apply(this,arguments))},first:function(){returnthis.eq(0)},last:function(){returnthis.eq(-1)},eq:function(t){vare=this.length,n= t (t0?e:0);returnthis.pushStack(n=0ne?[this[n]]:[])},end:function(){returnthis.prevObject||this.constructor()},push:l,sort:s.sort,splice:s.splice},C.extend=C.fn.extend=function(){vart,e,n,r,o,i,s=arguments[0]||{},a=1,u=arguments.length,c=!1;for("boolean"===typeofs(c=s,s=arguments[a]||{},a ),"object"===typeofs||b(s)||(s={}),a===u(s=this,a--);au;a )if(null!=(t=arguments[a]))for(eint)n=s[e],r=t[e],s!==r(cr(C.isPlainObject(r)||(o=Array.isArray(r)))?(o?(o=!1,i=nArray.isArray(n)?n:[]):i=nC.isPlainObject(n)?n:{},s[e]=C.extend(c,i,r)):void0!==r(s[e]=r));returns},C.extend({expando:"jQuery" (T Math.random()).replace(/D/g,""),isReady:!0,error:function(t){thrownewError(t)},noop:function(){},isPlainObject:function(t){vare,n;return!(!t||"[objectObject]"!==p.call(t))(e=u(t),!e||(n=v.call(e,"constructor")e.constructor,"function"===typeofng.call(n)===y))},isEmptyObject:function(t){vare;for(eint)return!1;return!0},globalEval:function(t){w(t)},each:function(t,e){varn,r=0;if(S(t)){for(n=t.length;rn;r )if(!1===e.call(t[r],r,t[r]))break}elsefor(rint)if(!1===e.call(t[r],r,t[r]))break;returnt},trim:function(t){returnnull==t?"":(t "").replace(O,"")},makeArray:function(t,e){varn=e||[];returnnull!=t(S(Object(t))?C.merge(n,"string"===typeoft?[t]:t):l.call(n,t)),n},inArray:function(t,e,n){returnnull==e?-1:d.call(e,t,n)},merge:function(t,e){for(varn= e.length,r=0,o=t.length;rn;r )t[o ]=e[r];returnt.length=o,t},grep:function(t,e,n){for(varr,o=[],i=0,s=t.length,a=!n;is;i )r=!e(t[i],i),r!==ao.push(t[i]);returno},map:function(t,e,n){varr,o,i=0,s=[];if(S(t))for(r=t.length;ir;i )o=e(t[i],i,n),null!=os.push(o);elsefor(iint)o=e(t[i],i,n),null!=os.push(o);returnf.apply([],s)},guid:1,support:m}),"function"===typeofSymbol(C.fn[Symbol.iterator]=s[Symbol.iterator]),C.each("BooleanNumberStringFunctionArrayDateRegExpObjectErrorSymbol".split(""),function(t,e){h["[object" e "]"]=e.toLowerCase()});varE=/*!*SizzleCSSSelectorEnginev2.3.3***CopyrightjQueryFoundationandothercontributors*ReleasedundertheMITlicense***Date:2016-08-08*/function(t){vare,n,r,o,i,s,a,u,c,f,l,d,h,p,v,g,y,m,b,x="sizzle" 1*newDate,_=t.document,w=0,A=0,T=st(),C=st(),O=st(),S=function(t,e){returnt===e(l=!0),0},E={}.hasOwnProperty,k=[],$=k.pop,L=k.push,j=k.push,N=k.slice,D=function(t,e){for(varn=0,r=t.length;nr;n )if(t[n]===e)returnn;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",U="[\x20\t\r\n\f]",M="(?:\\.|[\w-]|[^\0-\xa0]) ",I="\[" U "*(" M ")(?:" U "*([*^$|!~]?=)" U "*(?:'((?:\\.|[^\\'])*)'|"((?:\\.|[^\\"])*)"|(" M "))|)" U "*\]",R=":(" M ")(?:\((('((?:\\.|[^\\'])*)'|

 

 

 

首先,准备新建一个js文件。以下是JSON2.js的内容,把内容拷到js文件中,以便调用:

[javascript] 
/*
   
    2010-11-17
 
    Public Domain.
 
    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
 
    See
 
 
    This code should be minified before deployment.
    See
 
    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
    NOT CONTROL.
 
 
    This file creates a global JSON object containing two methods: stringify
    and parse.
 
        JSON.stringify(value, replacer, space)
            value       any JavaScript value, usually an object or array.
 
            replacer    an optional parameter that determines how object
                        values are stringified for objects. It can be a
                        function or an array of strings.
 
            space       an optional parameter that specifies the indentation
                        of nested structures. If it is omitted, the text will
                        be packed without extra whitespace. If it is a number,
                        it will specify the number of spaces to indent at each
                        level. If it is a string (such as 't' or ' '),
                        it contains the characters used to indent at each level.
 
            This method produces a JSON text from a JavaScript value.
 
            When an object value is found, if the object contains a toJSON
            method, its toJSON method will be called and the result will be
            stringified. A toJSON method does not serialize: it returns the
            value represented by the name/value pair that should be serialized,
            or undefined if nothing should be serialized. The toJSON method
            will be passed the key associated with the value, and this will be
            bound to the value
 
            For example, this would serialize Dates as ISO strings.
 
                Date.prototype.toJSON = function (key) {
                    function f(n) {
                        // Format integers to have at least two digits.
                        return n < 10 ? '0' n : n;
                    }
 
                    return this.getUTCFullYear()   '-'
                         f(this.getUTCMonth() 1) '-'
                         f(this.getUTCDate())      'T'
                         f(this.getUTCHours())     ':'
                         f(this.getUTCMinutes())   ':'
                         f(this.getUTCSeconds())   'Z';
                };
 
            You can provide an optional replacer method. It will be passed the
            key and value of each member, with this bound to the containing
            object. The value that is returned from your method will be
            serialized. If your method returns undefined, then the member will
            be excluded from the serialization.
 
            If the replacer parameter is an array of strings, then it will be
            used to select the members to be serialized. It filters the results
            such that only members with keys listed in the replacer array are
            stringified.
 
            Values that do not have JSON representations, such as undefined or
            functions, will not be serialized. Such values in objects will be
            dropped; in arrays they will be replaced with null. You can use
            a replacer function to replace those with JSON values.
            JSON.stringify(undefined) returns undefined.
 
            The optional space parameter produces a stringification of the
            value that is filled with line breaks and indentation to make it
            easier to read.
 
            If the space parameter is a non-empty string, then that string will
            be used for indentation. If the space parameter is a number, then
            the indentation will be that many spaces.
 
            Example:
 
            text = JSON.stringify(['e', {pluribus: 'unum'}]);
            // text is '["e",{"pluribus":"unum"}]'
 
 
            text = JSON.stringify(['e', {pluribus: 'unum'}], null, 't');
            // text is '[nt"e",nt{ntt"pluribus": "unum"nt}n]'
 
            text = JSON.stringify([new Date()], function (key, value) {
                return this[key] instanceof Date ?
                    'Date(' this[key] ')' : value;
            });
            // text is '["Date(---current time---)"]'
 
 
        JSON.parse(text, reviver)
            This method parses a JSON text to produce an object or array.
            It can throw a SyntaxError exception.
 
            The optional reviver parameter is a function that can filter and
            transform the results. It receives each of the keys and values,
            and its return value is used instead of the original value.
            If it returns what it received, then the structure is not modified.
            If it returns undefined then the member is deleted.
 
            Example:
 
            // Parse the text. Values that look like ISO date strings will
            // be converted to Date objects.
 
            myData = JSON.parse(text, function (key, value) {
                var a;
                if (typeof value === 'string') {
                    a =
/^(d{4})-(d{2})-(d{2})T(d{2}):(d{2}):(d{2}(?:.d*)?)Z$/.exec(value);
                    if (a) {
                        return new Date(Date.UTC( a[1], a[2] - 1, a[3], a[4],
                            a[5], a[6]));
                    }
                }
                return value;
            });
 
            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
                var d;
                if (typeof value === 'string' &&
                        value.slice(0, 5) === 'Date(' &&
                        value.slice(-1) === ')') {
                    d = new Date(value.slice(5, -1));
                    if (d) {
                        return d;
                    }
                }
                return value;
            });
 
 
    This is a reference implementation. You are free to copy, modify, or
    redistribute.
*/ 
 
/*jslint evil: true, strict: false, regexp: false */ 
 
/*members "", "b", "t", "n", "f", "r", """, JSON, "\", apply,
    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
    lastIndex, length, parse, prototype, push, replace, slice, stringify,
    test, toJSON, toString, valueOf
*/ 
 
 
// Create a JSON object only if one does not already exist. We create the  
// methods in a closure to avoid creating global variables.  
 
if (!this.JSON2) 

    this.JSON2 = {}; 

 
(function () { 
    "use strict"; 
 
    function f(n) { 
        // Format integers to have at least two digits.  
        return n < 10 ? '0' n : n; 
    } 
 
    if (typeof Date.prototype.toJSON !== 'function') { 
 
        Date.prototype.toJSON = function (key) { 
 
            return isFinite(this.valueOf()) ? 
                   this.getUTCFullYear()   '-'  
                 f(this.getUTCMonth() 1) '-'  
                 f(this.getUTCDate())      'T'  
                 f(this.getUTCHours())     ':'  
                 f(this.getUTCMinutes())   ':'  
                 f(this.getUTCSeconds())   'Z' : null; 
        }; 
 
        String.prototype.toJSON = 
        Number.prototype.toJSON = 
        Boolean.prototype.toJSON = function (key) { 
            return this.valueOf(); 
        }; 
    } 
 
    var cx = /[­u0600-u0604u070fu17b4u17b5u200c-u200fu2028-u202fu2060-u206fufeffufff0-uffff]/g, 
        escapable = /[\"x00-x1fx7f-x9fu00adu0600-u0604u070fu17b4u17b5u200c-u200fu2028-u202fu2060-u206fufeffufff0-uffff]/g, 
        gap, 
        indent, 
        meta = {    // table of character substitutions  
            'b': '\b', 
            't': '\t', 
            'n': '\n', 
            'f': '\f', 
            'r': '\r', 
            '"' : '\"', 
            '\': '\\' 
        }, 
        rep; 
 
 
    function quote(string) { 
 
        escapable.lastIndex = 0; 
        return escapable.test(string) ? 
            '"' string.replace(escapable, function (a) { 
                var c = meta[a]; 
                return typeof c === 'string' ? c : 
                    '\u' ('0000' a.charCodeAt(0).toString(16)).slice(-4); 
            }) '"' : 
            '"' string '"'; 
    } 
 
    function str(key, holder) { 
        var i,          // The loop counter.  
            k,          // The member key.  
            v,          // The member value.  
            length, 
            mind = gap, 
            partial, 
            value = holder[key]; 
        if (value && typeof value === 'object' && 
                typeof value.toJSON === 'function') { 
            value = value.toJSON(key); 
        } 
        if (typeof rep === 'function') { 
            value = rep.call(holder, key, value); 
        } 
        switch (typeof value) { 
        case 'string': 
            return quote(value); 
        case 'number': 
            return isFinite(value) ? String(value) : 'null'; 
        case 'boolean': 
        case 'null': 
            return String(value); 
        case 'object': 
            if (!value) { 
                return 'null'; 
            } 
            gap = indent; 
            partial = []; 
            if (Object.prototype.toString.apply(value) === '[object Array]') { 
                length = value.length; 
                for (i = 0; i < length; i = 1) { 
                    partial[i] = str(i, value) || 'null'; 
                } 
                v = partial.length === 0 ? '[]' : 
                    gap ? '[n' gap  
                            partial.join(',n' gap) 'n'  
                                mind ']' : 
                          '[' partial.join(',') ']'; 
                gap = mind; 
                return v; 
            } 
            if (rep && typeof rep === 'object') { 
                length = rep.length; 
                for (i = 0; i < length; i = 1) { 
                    k = rep[i]; 
                    if (typeof k === 'string') { 
                        v = str(k, value); 
                        if (v) { 
                            partial.push(quote(k) (gap ? ': ' : ':') v); 
                        } 
                    } 
                } 
            } else { 
                for (k in value) { 
                    if (Object.hasOwnProperty.call(value, k)) { 
                        v = str(k, value); 
                        if (v) { 
                            partial.push(quote(k) (gap ? ': ' : ':') v); 
                        } 
                    } 
                } 
            } 
            v = partial.length === 0 ? '{}' : 
                gap ? '{n' gap partial.join(',n' gap) 'n'  
                        mind '}' : '{' partial.join(',') '}'; 
            gap = mind; 
            return v; 
        } 
    } 
    if (typeof JSON2.stringify !== 'function') { 
        JSON2.stringify = function (value, replacer, space) { 
            var i; 
            gap = ''; 
            indent = ''; 
            if (typeof space === 'number') { 
                for (i = 0; i < space; i = 1) { 
                    indent = ' '; 
                } 
            } else if (typeof space === 'string') { 
                indent = space; 
            } 
            rep = replacer; 
            if (replacer && typeof replacer !== 'function' && 
                    (typeof replacer !== 'object' || 
                     typeof replacer.length !== 'number')) { 
                throw new Error('JSON2.stringify'); 
            } 
            return str('', {'': value}); 
        }; 
    } 
    if (typeof JSON2.parse !== 'function') { 
        JSON2.parse = function (text, reviver) { 
            var j; 
            function walk(holder, key) { 
                var k, v, value = holder[key]; 
                if (value && typeof value === 'object') { 
                    for (k in value) { 
                        if (Object.hasOwnProperty.call(value, k)) { 
                            v = walk(value, k); 
                            if (v !== undefined) { 
                                value[k] = v; 
                            } else { 
                                delete value[k]; 
                            } 
                        } 
                    } 
                } 
                return reviver.call(holder, key, value); 
            } 
            text = String(text); 
            cx.lastIndex = 0; 
            if (cx.test(text)) { 
                text = text.replace(cx, function (a) { 
                    return '\u'  
                        ('0000' a.charCodeAt(0).toString(16)).slice(-4); 
                }); 
            } 
            if (/^[],:{}s]*$/ 
.test(text.replace(/\(?:["\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') 
.replace(/"[^"\nr]*"|true|false|null|-?d (?:.d*)?(?:[eE][ -]?d )?/g, ']') 
.replace(/(?:^|:|,)(?:s*[) /g, ''))) { 
                j = eval('(' text ')'); 
                return typeof reviver === 'function' ? 
                    walk({'': j}, '') : j; 
            } 
            throw new SyntaxError('JSON2.parse'); 
        }; 
    } 
}()); 

/*
   
    2010-11-17

    Public Domain.

    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.

    See

    This code should be minified before deployment.
    See

    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
    NOT CONTROL.

    This file creates a global JSON object containing two methods: stringify
    and parse.

        JSON.stringify(value, replacer, space)
            value       any JavaScript value, usually an object or array.

            replacer    an optional parameter that determines how object
                        values are stringified for objects. It can be a
                        function or an array of strings.

            space       an optional parameter that specifies the indentation
                        of nested structures. If it is omitted, the text will
                        be packed without extra whitespace. If it is a number,
                        it will specify the number of spaces to indent at each
                        level. If it is a string (such as 't' or ' '),
                        it contains the characters used to indent at each level.

            This method produces a JSON text from a JavaScript value.

            When an object value is found, if the object contains a toJSON
            method, its toJSON method will be called and the result will be
            stringified. A toJSON method does not serialize: it returns the
            value represented by the name/value pair that should be serialized,
            or undefined if nothing should be serialized. The toJSON method
            will be passed the key associated with the value, and this will be
            bound to the value

            For example, this would serialize Dates as ISO strings.

                Date.prototype.toJSON = function (key) {
                    function f(n) {
                        // Format integers to have at least two digits.
                        return n < 10 ? '0' n : n;
                    }

                    return this.getUTCFullYear()   '-'
                         f(this.getUTCMonth() 1) '-'
                         f(this.getUTCDate())      'T'
                         f(this.getUTCHours())     ':'
                         f(this.getUTCMinutes())   ':'
                         f(this.getUTCSeconds())   'Z';
                };

            You can provide an optional replacer method. It will be passed the
            key and value of each member, with this bound to the containing
            object. The value that is returned from your method will be
            serialized. If your method returns undefined, then the member will
            be excluded from the serialization.

            If the replacer parameter is an array of strings, then it will be
            used to select the members to be serialized. It filters the results
            such that only members with keys listed in the replacer array are
            stringified.

            Values that do not have JSON representations, such as undefined or
            functions, will not be serialized. Such values in objects will be
            dropped; in arrays they will be replaced with null. You can use
            a replacer function to replace those with JSON values.
            JSON.stringify(undefined) returns undefined.

            The optional space parameter produces a stringification of the
            value that is filled with line breaks and indentation to make it
            easier to read.

            If the space parameter is a non-empty string, then that string will
            be used for indentation. If the space parameter is a number, then
            the indentation will be that many spaces.

            Example:

            text = JSON.stringify(['e', {pluribus: 'unum'}]);
            // text is '["e",{"pluribus":"unum"}]'

            text = JSON.stringify(['e', {pluribus: 'unum'}], null, 't');
            // text is '[nt"e",nt{ntt"pluribus": "unum"nt}n]'

            text = JSON.stringify([new Date()], function (key, value) {
                return this[key] instanceof Date ?
                    'Date(' this[key] ')' : value;
            });
            // text is '["Date(---current time---)"]'

        JSON.parse(text, reviver)
            This method parses a JSON text to produce an object or array.
            It can throw a SyntaxError exception.

            The optional reviver parameter is a function that can filter and
            transform the results. It receives each of the keys and values,
            and its return value is used instead of the original value.
            If it returns what it received, then the structure is not modified.
            If it returns undefined then the member is deleted.

            Example:

            // Parse the text. Values that look like ISO date strings will
            // be converted to Date objects.

            myData = JSON.parse(text, function (key, value) {
                var a;
                if (typeof value === 'string') {
                    a =
/^(d{4})-(d{2})-(d{2})T(d{2}):(d{2}):(d{2}(?:.d*)?)Z$/.exec(value);
                    if (a) {
                        return new Date(Date.UTC( a[1], a[2] - 1, a[3], a[4],
                            a[5], a[6]));
                    }
                }
                return value;
            });

            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
                var d;
                if (typeof value === 'string' &&
                        value.slice(0, 5) === 'Date(' &&
                        value.slice(-1) === ')') {
                    d = new Date(value.slice(5, -1));
                    if (d) {
                        return d;
                    }
                }
                return value;
            });

    This is a reference implementation. You are free to copy, modify, or
    redistribute.
*/

/*jslint evil: true, strict: false, regexp: false */

/*members "", "b", "t", "n", "f", "r", """, JSON, "\", apply,
    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
    lastIndex, length, parse, prototype, push, replace, slice, stringify,
    test, toJSON, toString, valueOf
*/

// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.

if (!this.JSON2)
{
    this.JSON2 = {};
}

(function () {
    "use strict";

    function f(n) {
        // Format integers to have at least two digits.
        return n < 10 ? '0' n : n;
    }

    if (typeof Date.prototype.toJSON !== 'function') {

        Date.prototype.toJSON = function (key) {

            return isFinite(this.valueOf()) ?
                   this.getUTCFullYear()   '-'
                 f(this.getUTCMonth() 1) '-'
                 f(this.getUTCDate())      'T'
                 f(this.getUTCHours())     ':'
                 f(this.getUTCMinutes())   ':'
                 f(this.getUTCSeconds())   'Z' : null;
        };

        String.prototype.toJSON =
        Number.prototype.toJSON =
        Boolean.prototype.toJSON = function (key) {
            return this.valueOf();
        };
    }

    var cx = /[­u0600-u0604u070fu17b4u17b5u200c-u200fu2028-u202fu2060-u206fufeffufff0-uffff]/g,
        escapable = /[\"x00-x1fx7f-x9fu00adu0600-u0604u070fu17b4u17b5u200c-u200fu2028-u202fu2060-u206fufeffufff0-uffff]/g,
        gap,
        indent,
        meta = {    // table of character substitutions
            'b': '\b',
            't': '\t',
            'n': '\n',
            'f': '\f',
            'r': '\r',
            '"' : '\"',
            '\': '\\'
        },
        rep;

    function quote(string) {

        escapable.lastIndex = 0;
        return escapable.test(string) ?
            '"' string.replace(escapable, function (a) {
                var c = meta[a];
                return typeof c === 'string' ? c :
                    '\u' ('0000' a.charCodeAt(0).toString(16)).slice(-4);
            }) '"' :
            '"' string '"';
    }

    function str(key, holder) {
        var i,          // The loop counter.
            k,          // The member key.
            v,          // The member value.
            length,
            mind = gap,
            partial,
            value = holder[key];
        if (value && typeof value === 'object' &&
                typeof value.toJSON === 'function') {
            value = value.toJSON(key);
        }
        if (typeof rep === 'function') {
            value = rep.call(holder, key, value);
        }
        switch (typeof value) {
        case 'string':
            return quote(value);
        case 'number':
            return isFinite(value) ? String(value) : 'null';
        case 'boolean':
        case 'null':
            return String(value);
        case 'object':
            if (!value) {
                return 'null';
            }
            gap = indent;
            partial = [];
            if (Object.prototype.toString.apply(value) === '[object Array]') {
                length = value.length;
                for (i = 0; i < length; i = 1) {
                    partial[i] = str(i, value) || 'null';
                }
                v = partial.length === 0 ? '[]' :
                    gap ? '[n' gap
                            partial.join(',n' gap) 'n'
                                mind ']' :
                          '[' partial.join(',') ']';
                gap = mind;
                return v;
            }
            if (rep && typeof rep === 'object') {
                length = rep.length;
                for (i = 0; i < length; i = 1) {
                    k = rep[i];
                    if (typeof k === 'string') {
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) (gap ? ': ' : ':') v);
                        }
                    }
                }
            } else {
                for (k in value) {
                    if (Object.hasOwnProperty.call(value, k)) {
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) (gap ? ': ' : ':') v);
                        }
                    }
                }
            }
            v = partial.length === 0 ? '{}' :
                gap ? '{n' gap partial.join(',n' gap) 'n'

  •                         mind '}' : '{' partial.join(',') '}';
                gap = mind;
                return v;
            }
        }
        if (typeof JSON2.stringify !== 'function') {
            JSON2.stringify = function (value, replacer, space) {
                var i;
                gap = '';
                indent = '';
                if (typeof space === 'number') {
                    for (i = 0; i < space; i = 1) {
                        indent = ' ';
                    }
                } else if (typeof space === 'string') {
                    indent = space;
                }
                rep = replacer;
                if (replacer && typeof replacer !== 'function' &&
                        (typeof replacer !== 'object' ||
                         typeof replacer.length !== 'number')) {
                    throw new Error('JSON2.stringify');
                }
                return str('', {'': value});
            };
        }
        if (typeof JSON2.parse !== 'function') {
            JSON2.parse = function (text, reviver) {
                var j;
                function walk(holder, key) {
                    var k, v, value = holder[key];
                    if (value && typeof value === 'object') {
                        for (k in value) {
                            if (Object.hasOwnProperty.call(value, k)) {
                                v = walk(value, k);
                                if (v !== undefined) {
                                    value[k] = v;
                                } else {
                                    delete value[k];
                                }
                            }
                        }
                    }
                    return reviver.call(holder, key, value);
                }
                text = String(text);
                cx.lastIndex = 0;
                if (cx.test(text)) {
                    text = text.replace(cx, function (a) {
                        return '\u'
                            ('0000' a.charCodeAt(0).toString(16)).slice(-4);
                    });
                }
                if (/^[],:{}s]*$/
    .test(text.replace(/\(?:["\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
    .replace(/"[^"\nr]*"|true|false|null|-?d (?:.d*)?(?:[eE][ -]?d )?/g, ']')
    .replace(/(?:^|:|,)(?:s*[) /g, ''))) {
                    j = eval('(' text ')');
                    return typeof reviver === 'function' ?
                        walk({'': j}, '') : j;
                }
                throw new SyntaxError('JSON2.parse');
            };
        }
    }());

第二、调用页的内容

注意:调用js文件的路径需要自己调整,这点如果不会,那就别再继续看了。

 

 

[javascript]
<script src="../jquery/jquery-1.5.2.min.js" type="text/javascript"></script> 
 <script src="../json2.js" type="text/javascript"></script> 
 
     var a = '{ "name": "tom", "sex": "男", "age": "24" }';    // 用于组成json的字符串;  
     alert("用于组成json的字符串:【" a "】"); 
 
     var b = JSON2.parse(a);   // 把字符串a转换为json格式b  
 
     var c = JSON2.stringify(a); //把json格式b转换为字符串c  
     alert("转换后的字符串:【" c "】"); 

   <script src="../jquery/jquery-1.5.2.min.js" type="text/javascript"></script>
    <script src="../json2.js" type="text/javascript"></script>

        var a = '{ "name": "tom", "sex": "男", "age": "24" }';    // 用于组成json的字符串;
        alert("用于组成json的字符串:【" a "】");

        var b = JSON2.parse(a);   // 把字符串a转换为json格式b

        var c = JSON2.stringify(a); //把json格式b转换为字符串c
        alert("转换后的字符串:【" c "】");

 

 

...

编辑:操作系统 本文来源:有一个浏览器的关注批量点击插件因为停用了找

关键词: 必赢官网