代码之家  ›  专栏  ›  技术社区  ›  Shikiryu DhruvJoshi

Tumblr bookmarklet javascript中的tstbklt()做什么?

  •  3
  • Shikiryu DhruvJoshi  · 技术社区  · 15 年前
    javascript: var d = document,
        w = window,
        e = w.getSelection,
        k = d.getSelection,
        x = d.selection,
        s = (e ? e() : (k) ? k() : (x ? x.createRange().text : 0)),
        f = 'http://www.tumblr.com/share',
        l = d.location,
        e = encodeURIComponent,
        p = '?v=3&u=' + e(l.href) + '&t=' + e(d.title) + '&s=' + e(s),
        u = f + p;
    try {
        if (!/^(.*\.)?tumblr[^.]*$/.test(l.host)) throw (0);
        tstbklt();
    } catch (z) {
        a = function () {
            if (!w.open(u, 't', 'toolbar=0,resizable=0,status=1,width=450,height=430')) l.href = u;
        };
        if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0);
        else a();
    }
    void(0)
    

    这是Tumblr书签的代码。 tstbklt(); 功能是。。。

    1 回复  |  直到 15 年前
        1
  •  3
  •   Andy E    15 年前

    功能 tstbklt 似乎只在 http://tumblr.com/goodies (需要帐户),如下所示:

    function tstbklt() {
        alert('You\'ve successfully installed the bookmarklet!');
        return false;
    }
    

    catch 将执行子句。