昨天发现一个站出现个弹窗 相当诡异 挖了3个小时才找出代码存放的地方,代码可以崁入到任何其他JS文件里面Cookie 控制的 但是 在以下代码里面确找不到 调用的地址  代码以下  知道的 老大帮帮忙研究以下 小弟研究好几个小时了!(function(){var J="MULTI";var r="BAIDU_CLB_SLOTS_MAP";if(!window[r]){window[r]={}}var t="BAIDU_CLB_SLOTS_MANAGER";if(!window[t]){window[t]={_container:{},register:function(O){this._container[O]=1}}}window.BAIDU_CLB_addSlot=function(O){window[t].register(O)};window.BAIDU_CLB_enableAllSlots=new Function();var N="http://cb.baidu.com/ecom",c="http://drmcmm.baidu.com/js/img/close.gif";function y(O){return window.encodeURIComponent?encodeURIComponent(O):escape(O)}function n(P,R,Q,T,S){var O=new Date();S&&(O.setTime(O.getTime()+S));document.cookie=P+"="+escape(R)+(S?";expires="+O.toGMTString():"")+(Q?";domain="+escape(Q):"")+(T?";path="+escape(T):"")}function h(P){var Q=new RegExp("(^| )"+P+"=([^;]*)(;|$)"),O=Q.exec(document.cookie);if(O){return unescape(O[2]||"")}return""}function x(Q){Q=Q||document.domain;if(Q.indexOf("www.")===0){Q=Q.substr(4)}var P=/([a-z0-9][a-z0-9\-]*?\.(?:com|cn|net|org|gov|info|la|cc|co|jp)(?:\.(?:cn|jp))?)$/,O=Q.match(P);if(O){return O[0]}return Q}function E(){return window.screen.width}function u(){return window.screen.height}function g(){return window.screen.availWidth}function M(){return window.screen.availHeight}function B(){return window.screen.colorDepth}function A(){return(new Date(document.lastModified)).getTime()}function j(){var O=navigator;return(O.language||O.browserLanguage)}function K(){return navigator.javaEnabled()?1:0}function k(){var Q,P,O,R=navigator;if(R.plugins&&R.mimeTypes.length){O=R.plugins["Shockwave Flash"];if(O&&O.description){return O.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s)+r/,".")}}else{if(R.userAgent&&R.userAgent.indexOf("Windows CE")>=0){P=3;Q=1;while(Q){try{Q=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+(P+1));P++}catch(S){break}}return P.toString()}else{if(i()){try{Q=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(S){var P=0;try{Q=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");P=6;Q.AllowScriptAccess="always"}catch(S){if(P==6){return P.toString()}}try{Q=new ActiveXObject("ShockwaveFlash,ShockwaveFlash")}catch(S){}}if(Q){return Q.GetVariable("$version").split(" ")[1].replace(/,/g,".")}}}}return"0"}function z(){var P=document.referrer,S=P.replace(/^http:\/\//,""),R=S.indexOf("/");if(R!=-1){S=S.substr(0,R)}S=S.replace(/:\d+$/,"");S=x(S);var O=x(),Q=h("BAIDU_CLB_REFER");if(O==S&&Q!=""){return y(Q)}else{if(O!=S){n("BAIDU_CLB_REFER",P,O);return y(P)}}return""}function a(){return y(document.URL)}function F(Q,P){var O="di="+Q+(P?"&fn="+P:"")+"&tm=BAIDU_CLB_SETJSONADSLOT&mod_t="+A()+"&visi_t="+(new Date()).getTime()+"&flash_v="+k()+"&java="+K();if(window.screen){O+="&screen_h="+u()+"&screen_w="+E()+"&page_h="+M()+"&page_w="+g()+"&color="+B()}O+="&asp_refer="+z()+"&asp_url="+a()+"&b_lang="+j()+"&baidu_id="+h("BAIDUID");return N+"?"+O}function e(O){return"baidu_clb_slot_"+O}function I(O){return"baidu_clb_slot_iframe_"+O}function w(P,O){var Q;switch(O._stype){case 0:Q=q;break;case 1:Q=p;break;default:Q=o}Q(P,O)}function q(R,P){var S=P._html,T=P._w,O=P._h,Q=e(R);if(!S&&!P._fxp){return}if(S&&P._isMlt){document.write(S)}else{if(i()){document.write('<div id="'+Q+'">'+v(R,T,O)+"</div>")}else{document.write('<div id="'+Q+'"></div>');f(R,Q,T,O,P._html)}}}function p(P,O){if(O._html==""){return}if(window.attachEvent){window.attachEvent("onload",R);window.attachEvent("onresize",Q);if(s()<7||m()){window.attachEvent("onscroll",Q)}}else{if(window.addEventListener){window.addEventListener("load",R,false);window.addEventListener("resize",Q,false)}}function R(){if(i()){L(P,O)}else{D(P,O)}var S=O._st;if(S>0){window.setTimeout(function(){var T=document.getElementById(e(P));if(T){T.style.display="none"}},S*1000)}}function Q(){d(P,O)}}function o(R,Y){var Q=Y._h,P=Y._w,X=0,Z=0,S=Y._html,T,W,O,U="newwindow"+R,V="about:blank";if(S==""){return}if(i()&&document.domain!=location.hostname){V="javascript:void( (function(){var d=document;d.open();"+H()+"d.write('');d.close();})() )"}if(Y._top==1){X=Y._hs}else{if(window.screen){X=M()-Y._hs-Q}}if(Y._left==1){Z=Y._vs}else{if(window.screen){Z=g()-Y._vs-P}}O="height="+Q+",width="+P+",top="+X+",left="+Z+",screenX="+X+",screenY="+Z+",toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no";if(Y._bf||!i()){T=window.open(V,U,O);if(T){W=T.document;W.open("text/html","replace");W.write(S);W.close();if(Y._st>0){window.setTimeout(function(){T&&(T.close())},Y._st*1000)}}}else{if(window.attachEvent){window.attachEvent("onunload",function(){var aa=window.event;if((aa.clientY<0&&!aa.ctrlKey)||aa.altKey){var ac=window.open(V,U,O);if(ac){var ab=ac.document;ab.open("text/html","replace");ab.write(S);ac.focus()}}})}}}function d(S,Y){var Q=document.getElementById(e(S));if(!Q){return}var P=Q.style,U=Y._vs,T=Y._hs,O=m(),X=document,V=(O?document.body:document.documentElement),W=X.documentElement.scrollTop||X.body.scrollTop,R=X.documentElement.scrollLeft||X.body.scrollLeft;if(i()&&(s()<7||O)){if(Y._sf){if(Y._top==1){P.top=(W+T)+"px"}else{if(s()<7){P.top=(W+V.clientHeight-T-Y._h-17)+"px"}else{P.bottom=T-W+"px"}}if(Y._left==1){P.left=(R+U)+"px"}else{P.right=U-R+"px"}}else{if(Y._top!=1){P.top=(V.clientHeight-T-Y._h-17)+"px"}}}}function L(Q,P){var O="absolute",R=document.createElement("div");if(P._sf){if(s()>6&&!m()){O="fixed"}}R.id=e(Q);R.style.position=O;l(R,P);R.innerHTML=v(Q,P._w,P._h)+G();document.body.appendChild(R)}function D(R,O){var Q=e(R),O=window[r][R],S=document.getElementById(Q),P;if(!S){S=document.createElement("div");S.id=Q}S.innerHTML=G();P=S.style;P.position=O._sf?"fixed":"absolute";l(S,O);document.body.appendChild(S);f(R,Q,O._w,O._h,O._html)}function l(P,O){var Q=P.style;Q[(O._left==1?"left":"right")]=O._vs+"px";Q[(O._top==1?"top":"bottom")]=O._hs+"px";Q.width=O._w+"px";Q.height=(O._h-0+17)+"px";Q.border="0";Q.zIndex="2147483647"}function f(Q,S,P,W,R){var U=I(Q),O=document.getElementById(S),V=document.createElement("iframe");V.id=U;V.name=U;V.width=P;V.height=W;V.vspace=0;V.hspace=0;V.allowTransparency="true";V.scrolling="no";V.marginWidth=0;V.marginHeight=0;V.frameBorder=0;V.style.border=0;V.style.display="block";O.insertBefore(V,O.firstChild);var T=V.contentWindow.document;T.write(R);window.setTimeout(function(){T.close()},0)}function v(P,Q,O){var R=I(P);return'<iframe id="'+R+'" name="'+R+'"  width="'+Q+'" height="'+O+'" vspace="0" hspace="0" allowTransparency="true" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" style="border:0px;vertical-align:bottom" src="javascript:void((function(){var d=document;d.open(\'text/html\', \'replace\');'+H()+"d.write(parent."+r+"['"+P+"']._html);d.close()})())\"></iframe>"}function G(){return'<div style="height:'+(i()&&m()?"17":"15")+"px;border:1px solid #E1E1E1;background:#F0F0F0;padding:0;margin:0;"+(i()?"overflow:hidden;":"")+'"><div style="float:right;clear:right;margin:2px 5px 0 0;width:39px;height:15px;cursor:pointer;background:transparent url(\''+c+"') no-repeat scroll 0 0;"+(i()?"_display:inline;":"")+'" onmouseover="this.style.backgroundPosition=\'0 -20px\';" onmouseout="this.style.backgroundPosition=\'0 0\';" onclick="this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);"></div></div>'}function H(){if(document.domain!=location.hostname){return"document.domain='"+document.domain+"';"}return""}function i(){return/msie/i.test(navigator.userAgent)&&!window.opera}function s(){var P=navigator.userAgent,O=P.indexOf("MSIE ");return O==-1?0:parseFloat(P.substring(O+5,P.indexOf(";",O)))}function m(){return(document.compatMode=="CSS1Compat"?false:true)}function C(Q){var P,R,S,O;for(R in Q){S=Q[R];if(typeof S!="function"){P=R;O=S}}window[r][P]=O;w(P,O)}var b="BAIDU_CLB_SETJSONADSLOT";window[b]=C;window.BAIDU_CLB_fillSlot=function(O){if(!window[r][O]){document.write('<script type="text/javascript" charset="utf-8" src="'+F(O,b)+'"><\/script>')}};window.BAIDU_CLB_SETHTMLSLOT=new Function()})();

解决方案 »

  1.   

    网上有很多js 排版工具,这样处理一下,看起来就容易多了(function () {
        var J = "MULTI";
        var r = "BAIDU_CLB_SLOTS_MAP";
        if (!window[r]) {
            window[r] = {}
        }
        var t = "BAIDU_CLB_SLOTS_MANAGER";
        if (!window[t]) {
            window[t] = {
                _container: {},
                register: function (O) {
                    this._container[O] = 1
                }
            }
        }
        window.BAIDU_CLB_addSlot = function (O) {
            window[t].register(O)
        };
        window.BAIDU_CLB_enableAllSlots = new Function();
        var N = "http://cb.baidu.com/ecom",
            c = "http://drmcmm.baidu.com/js/img/close.gif";    function y(O) {
            return window.encodeURIComponent ? encodeURIComponent(O) : escape(O)
        }
        function n(P, R, Q, T, S) {
            var O = new Date();
            S && (O.setTime(O.getTime() + S));
            document.cookie = P + "=" + escape(R) + (S ? ";expires=" + O.toGMTString() : "") + (Q ? ";domain=" + escape(Q) : "") + (T ? ";path=" + escape(T) : "")
        }
        function h(P) {
            var Q = new RegExp("(^| )" + P + "=([^;]*)(;|$)"),
                O = Q.exec(document.cookie);
            if (O) {
                return unescape(O[2] || "")
            }
            return ""
        }
        function x(Q) {
            Q = Q || document.domain;
            if (Q.indexOf("www.") === 0) {
                Q = Q.substr(4)
            }
            var P = /([a-z0-9][a-z0-9\-]*?\.(?:com|cn|net|org|gov|info|la|cc|co|jp)(?:\.(?:cn|jp))?)$/,
                O = Q.match(P);
            if (O) {
                return O[0]
            }
            return Q
        }
        function E() {
            return window.screen.width
        }
        function u() {
            return window.screen.height
        }
        function g() {
            return window.screen.availWidth
        }
        function M() {
            return window.screen.availHeight
        }
        function B() {
            return window.screen.colorDepth
        }
        function A() {
            return (new Date(document.lastModified)).getTime()
        }
        function j() {
            var O = navigator;
            return (O.language || O.browserLanguage)
        }
        function K() {
            return navigator.javaEnabled() ? 1 : 0
        }
        function k() {
            var Q, P, O, R = navigator;
            if (R.plugins && R.mimeTypes.length) {
                O = R.plugins["Shockwave Flash"];
                if (O && O.description) {
                    return O.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s)+r/, ".")
                }
            } else {
                if (R.userAgent && R.userAgent.indexOf("Windows CE") >= 0) {
                    P = 3;
                    Q = 1;
                    while (Q) {
                        try {
                            Q = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + (P + 1));
                            P++
                        } catch (S) {
                            break
                        }
                    }
                    return P.toString()
                } else {
                    if (i()) {
                        try {
                            Q = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")
                        } catch (S) {
                            var P = 0;
                            try {
                                Q = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
                                P = 6;
                                Q.AllowScriptAccess = "always"
                            } catch (S) {
                                if (P == 6) {
                                    return P.toString()
                                }
                            }
                            try {
                                Q = new ActiveXObject("ShockwaveFlash,ShockwaveFlash")
                            } catch (S) {}
                        }
                        if (Q) {
                            return Q.GetVariable("$version").split(" ")[1].replace(/,/g, ".")
                        }
                    }
                }
            }
            return "0"
        }
      
      

  2.   


      function z() {
            var P = document.referrer,
                S = P.replace(/^http:\/\//, ""),
                R = S.indexOf("/");
            if (R != -1) {
                S = S.substr(0, R)
            }
            S = S.replace(/:\d+$/, "");
            S = x(S);
            var O = x(),
                Q = h("BAIDU_CLB_REFER");
            if (O == S && Q != "") {
                return y(Q)
            } else {
                if (O != S) {
                    n("BAIDU_CLB_REFER", P, O);return y(P)
                }
            } return ""
        }
        function a() {
            return y(document.URL)
        }
        function F(Q, P) {
            var O = "di=" + Q + (P ? "&fn=" + P : "") + "&tm=BAIDU_CLB_SETJSONADSLOT&mod_t=" + A() + "&visi_t=" + (new Date()).getTime() + "&flash_v=" + k() + "&java=" + K();
            if (window.screen) {
                O += "&screen_h=" + u() + "&screen_w=" + E() + "&page_h=" + M() + "&page_w=" + g() + "&color=" + B()
            }
            O += "&asp_refer=" + z() + "&asp_url=" + a() + "&b_lang=" + j() + "&baidu_id=" + h("BAIDUID");
            return N + "?" + O
        }
        function e(O) { return "baidu_clb_slot_" + O}
        function I(O) { return "baidu_clb_slot_iframe_" + O}
        function w(P, O) {
            var Q;
            switch (O._stype) {
            case 0:
                Q = q;
                break;
            case 1:
                Q = p;
                break;
            default:
                Q = o
            }
            Q(P, O)
        }
        function q(R, P) {
            var S = P._html,
                T = P._w,
                O = P._h,
                Q = e(R);
            if (!S && !P._fxp) {
                return
            }
            if (S && P._isMlt) {
                document.write(S)
            } else {
                if (i()) {
                    document.write('<div id="' + Q + '">' + v(R, T, O) + "</div>")
                } else {
                    document.write('<div id="' + Q + '"></div>');
                    f(R, Q, T, O, P._html)
                }
            }
        }
        function p(P, O) {
            if (O._html == "") {return }
            if (window.attachEvent) {
                window.attachEvent("onload", R);
                window.attachEvent("onresize", Q);
                if (s() < 7 || m()) {
                    window.attachEvent("onscroll", Q)
                }
            } else {
                if (window.addEventListener) {
                    window.addEventListener("load", R, false);
                    window.addEventListener("resize", Q, false)
                }
            }
            function R() {
                if (i()) {
                    L(P, O)
                } else {
                    D(P, O)
                }
                var S = O._st;
                if (S > 0) {
                    window.setTimeout(function () {
                        var T = document.getElementById(e(P));
                        if (T) {T.style.display = "none"}
                    }, S * 1000)
                }
            }
            function Q() {
                d(P, O)
            }
        }
        function o(R, Y) {
            var Q = Y._h,
                P = Y._w,
                X = 0,
                Z = 0,
                S = Y._html,
                T, W, O, U = "newwindow" + R,
                V = "about:blank";
            if (S == "") {
                return
            }
            if (i() && document.domain != location.hostname) {
                V = "javascript:void( (function(){var d=document;d.open();" + H() + "d.write('');d.close();})() )"
            }
            if (Y._top == 1) {
                X = Y._hs
            } else {
                if (window.screen) {
                    X = M() - Y._hs - Q
                }
            }
            if (Y._left == 1) {
                Z = Y._vs
            } else {
                if (window.screen) {
                    Z = g() - Y._vs - P
                }
            }
            O = "height=" + Q + ",width=" + P + ",top=" + X + ",left=" + Z + ",screenX=" + X + ",screenY=" + Z + ",toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no";
            if (Y._bf || !i()) {
                T = window.open(V, U, O);
                if (T) {
                    W = T.document;
                    W.open("text/html", "replace");
                    W.write(S);
                    W.close();
                    if (Y._st > 0) {
                        window.setTimeout(function () {
                            T && (T.close())
                        }, Y._st * 1000)
                    }
                }
            } else {
                if (window.attachEvent) {
                    window.attachEvent("onunload", function () {
                        var aa = window.event;
                        if ((aa.clientY < 0 && !aa.ctrlKey) || aa.altKey) {
                            var ac = window.open(V, U, O);
                            if (ac) {
                                var ab = ac.document;
                                ab.open("text/html", "replace");
                                ab.write(S);
                                ac.focus()
                            }
                        }
                    })
                }
            }
        }
        function d(S, Y) {
            var Q = document.getElementById(e(S));
            if (!Q) {
                return
            }
            var P = Q.style,
                U = Y._vs,
                T = Y._hs,
                O = m(),
                X = document,
                V = (O ? document.body : document.documentElement),
                W = X.documentElement.scrollTop || X.body.scrollTop,
                R = X.documentElement.scrollLeft || X.body.scrollLeft;
            if (i() && (s() < 7 || O)) {
                if (Y._sf) {
                    if (Y._top == 1) {
                        P.top = (W + T) + "px"
                    } else {
                        if (s() < 7) {
                            P.top = (W + V.clientHeight - T - Y._h - 17) + "px"
                        } else {
                            P.bottom = T - W + "px"
                        }
                    }
                    if (Y._left == 1) {
                        P.left = (R + U) + "px"
                    } else {
                        P.right = U - R + "px"
                    }
                } else {
                    if (Y._top != 1) {
                        P.top = (V.clientHeight - T - Y._h - 17) + "px"
                    }
                }
            }
        }
        function L(Q, P) {
            var O = "absolute",
                R = document.createElement("div");
            if (P._sf) {
                if (s() > 6 && !m()) {
                    O = "fixed"
                }
            }
            R.id = e(Q);
            R.style.position = O;
            l(R, P);
            R.innerHTML = v(Q, P._w, P._h) + G();
            document.body.appendChild(R)
        }
        function D(R, O) {
            var Q = e(R),
                O = window[r][R],
                S = document.getElementById(Q),
                P;
            if (!S) {
                S = document.createElement("div");
                S.id = Q
            }
            S.innerHTML = G();
            P = S.style;
            P.position = O._sf ? "fixed" : "absolute";
            l(S, O);
            document.body.appendChild(S);
            f(R, Q, O._w, O._h, O._html)
        }
        function l(P, O) {
            var Q = P.style;
            Q[(O._left == 1 ? "left" : "right")] = O._vs + "px";
            Q[(O._top == 1 ? "top" : "bottom")] = O._hs + "px";
            Q.width = O._w + "px";
            Q.height = (O._h - 0 + 17) + "px";
            Q.border = "0";
            Q.zIndex = "2147483647"
        }
        function f(Q, S, P, W, R) {
            var U = I(Q),
                O = document.getElementById(S),
                V = document.createElement("iframe");
            V.id = U;
            V.name = U;
            V.width = P;
            V.height = W;
            V.vspace = 0;
            V.hspace = 0;
            V.allowTransparency = "true";
            V.scrolling = "no";
            V.marginWidth = 0;
            V.marginHeight = 0;
            V.frameBorder = 0;
            V.style.border = 0;
            V.style.display = "block";
            O.insertBefore(V, O.firstChild);
            var T = V.contentWindow.document;
            T.write(R);
            window.setTimeout(function () {
                T.close()
            }, 0)
        }
        function v(P, Q, O) {
            var R = I(P);
            return '<iframe id="' + R + '" name="' + R + '" width="' + Q + '" height="' + O + '" vspace="0" hspace="0" allowTransparency="true" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" style="border:0px;vertical-align:bottom" src="javascript:void((function(){var d=document;d.open(\'text/html\', \'replace\');' + H() + "d.write(parent." + r + "['" + P + "']._html);d.close()})())\"></iframe>"
        }
        function G() {
            return '<div style="height:' + (i() && m() ? "17" : "15") + "px;border:1px solid #E1E1E1;background:#F0F0F0;padding:0;margin:0;" + (i() ? "overflow:hidden;" : "") + '"><div style="float:right;clear:right;margin:2px 5px 0 0;width:39px;height:15px;cursor:pointer;background:transparent url(\'' + c + "') no-repeat scroll 0 0;" + (i() ? "_display:inline;" : "") + '" onmouseover="this.style.backgroundPosition=\'0 -20px\';" onmouseout="this.style.backgroundPosition=\'0 0\';" onclick="this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);"></div></div>'
        }
        function H() {
            if (document.domain != location.hostname) {
                return "document.domain='" + document.domain + "';"
            }
            return ""
        }
        function i() {
            return /msie/i.test(navigator.userAgent) && !window.opera
        }
        function s() {
            var P = navigator.userAgent,
                O = P.indexOf("MSIE ");
            return O == -1 ? 0 : parseFloat(P.substring(O + 5, P.indexOf(";", O)))
        }
        function m() {
            return (document.compatMode == "CSS1Compat" ? false : true)
        }
       
      

  3.   


    分成3段终于可以发表了
     function C(Q) {
            var P, R, S, O;
            for (R in Q) {
                S = Q[R];
                if (typeof S != "function") {
                    P = R;O = S
                }
            }
            window[r][P] = O;w(P, O)
        }
        var b = "BAIDU_CLB_SETJSONADSLOT";
        window[b] = C;
        window.BAIDU_CLB_fillSlot = function (O) {
            if (!window[r][O]) {
                document.write('<script type="text/javascript" charset="utf-8" src="' + F(O, b) + '"><\/script>')
            }
        }; window.BAIDU_CLB_SETHTMLSLOT = new Function()})();
      

  4.   

    这是百度的js代码,http://drmcmm.baidu.com/js/m.js;貌似是放上百度推广的广告就会加载的;最近一直研究这个,网上这方面的资料貌似不多。