※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。

JavaScript整形


例えば、以下のコードは Google の検索ページを右クリックしてソースコードを表示させて、
JavaScript 部分を取り出したものですが、整形する事によって読めるようになります
window.google={kEI:"IbCzR_aPEZWMsALe2oHcCg",kEXPI:"17259,17735,17870,17981",kHL:"ja"};
function sf(){document.f.q.focus()}
window.clk=function(b,c,d,e,f,g){if(document.images){var a=encodeURIComponent||escape;(new Image).src="/url?sa=T"+(c?"&oi="+a(c):"")+(d?"&cad="+a(d):"")+"&ct="+a(e)+"&cd="+a(f)+(b?"&url="+a(b.replace(/#.*/,"")).replace(/\+/g,"%2B"):"")+"&ei=IbCzR_aPEZWMsALe2oHcCg"+g}return true};
window.gbar={};(function(){var b=window.gbar,c,g,h;function n(d,f,e){d.visibility=h?"hidden":"visible";d.left=f+"px";d.top=e+"px"}b.tg=function(d){var f=0,e=0,a,i=0,o,l=window.navExtra,m,j=document,k=0;g=g||j.getElementById("gbar").getElementsByTagName("span");(d||window.event).cancelBubble=!i;if(!c){c=j.createElement(Array.every||window.createPopup?"iframe":"DIV");c.frameBorder="0";c.scrolling="no";c.src="#";g[7].parentNode.appendChild(c).id="gbi";if(l&&g[7])for(o in l){m=j.createElement("span");m.appendChild(l[o]);g[7].parentNode.insertBefore(m,g[7]).className="gb2"}j.onclick=b.close}while(a=g[++i]){if(e){n(a.style,e+1,f+25);k=Math.max(k,a.firstChild.tagName=="A"&&a.offsetWidth);f+=a.firstChild.tagName=="DIV"?9:20}if(a.className=="gb3"){do e+=a.offsetLeft;while(a=a.offsetParent)}}{i=0;while(a=g[++i]){if(a.className=="gb2")a.style.width=k+"px"}c.style.width=k+"px"}c.style.height=f+"px";n(c.style,e,24);h=!h};b.close=function(d){h&&b.tg(d)}})();
 
window.google = {
    kEI: "IbCzR_aPEZWMsALe2oHcCg",
    kEXPI: "17259,17735,17870,17981",
    kHL: "ja"
};
function sf() {
    document.f.q.focus()
}
window.clk = function(b, c, d, e, f, g) {
    if (document.images) {
        var a = encodeURIComponent || escape; (new Image).src = "/url?sa=T" + (c ? "&oi=" + a(c) : "") + (d ? "&cad=" + a(d) : "") + "&ct=" + a(e) + "&cd=" + a(f) + (b ? "&url=" + a(b.replace(/#.*/, "")).replace(/\+/g, "%2B") : "") + "&ei=IbCzR_aPEZWMsALe2oHcCg" + g
    }
    return true
};
window.gbar = {}; (function() {
    var b = window.gbar,
    c,
    g,
    h;
    function n(d, f, e) {
        d.visibility = h ? "hidden": "visible";
        d.left = f + "px";
        d.top = e + "px"
    }
    b.tg = function(d) {
        var f = 0,
        e = 0,
        a,
        i = 0,
        o,
        l = window.navExtra,
        m,
        j = document,
        k = 0;
        g = g || j.getElementById("gbar").getElementsByTagName("span"); (d || window.event).cancelBubble = !i;
        if (!c) {
            c = j.createElement(Array.every || window.createPopup ? "iframe": "DIV");
            c.frameBorder = "0";
            c.scrolling = "no";
            c.src = "#";
            g[7].parentNode.appendChild(c).id = "gbi";
            if (l && g[7]) for (o in l) {
                m = j.createElement("span");
                m.appendChild(l[o]);
                g[7].parentNode.insertBefore(m, g[7]).className = "gb2"
            }
            j.onclick = b.close
        }
        while (a = g[++i]) {
            if (e) {
                n(a.style, e + 1, f + 25);
                k = Math.max(k, a.firstChild.tagName == "A" && a.offsetWidth);
                f += a.firstChild.tagName == "DIV" ? 9: 20
            }
            if (a.className == "gb3") {
                do e += a.offsetLeft;
                while (a = a.offsetParent)
            }
        } {
            i = 0;
            while (a = g[++i]) {
                if (a.className == "gb2") a.style.width = k + "px"
            }
            c.style.width = k + "px"
        }
        c.style.height = f + "px";
        n(c.style, e, 24);
        h = !h
    };
    b.close = function(d) {
        h && b.tg(d)
    }
})();