dollar dayz

    技术2022-07-11  144

    dollar dayz

    Many of you probably didn't know this but WebKit-based like Safari and Chrome, in addition to Firefox, contain special dollar functions within the console object that allow you to grab elements within the current page.  While I've not determined the use of each method, a few of them are obvious:

    你们中的许多人可能不知道这一点,但是除了Firefox之外,基于Safari和Chrome的基于WebKit的控制台对象中还包含特殊的美元功能,可让您在当前页面中获取元素。 尽管我尚未确定每种方法的使用方式,但其中一些显而易见:

    // Dollar method // Returns an element by ID $ = function (id) { return document.getElementById.apply(document, arguments); } // Bling-Bling method // Returns array of nodes found by QSA $$ = function(selector) { return document.querySelectorAll.apply(document, arguments); } // Broke method // returns the currently selected element within the console HTML pane $0 = function toString() { [native code] }

    The $1 - $4 methods are returning undefined, oddly enough.

    $ 1-$ 4方法返回的是不确定的,这很奇怪。

    It's not clear to me what the last few methods do.  Maybe they're placeholders for feature methods but they continue to be undefined for now.

    我不清楚最后几种方法的作用。 也许它们是特征方法的占位符,但目前仍未定义。

    翻译自: https://davidwalsh.name/dollar-functions

    dollar dayz

    相关资源:jdk-8u281-windows-x64.exe
    Processed: 0.010, SQL: 9