在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ chrome報(bào)錯(cuò)*,:x is not a valid selector,fir

chrome報(bào)錯(cuò)*,:x is not a valid selector,firefox下面運(yùn)行良好

clipboard.png

clipboard.png

clipboard.png

clipboard.png

回答
編輯回答
野橘
It is not a bug, it is a feature.

jQuery用一些測(cè)試來檢測(cè)瀏覽器的兼容性,如果報(bào)exception,就說明不兼容。當(dāng)然,這些exception都被包在了try...catch里面。點(diǎn)上 Pause on caught exception 的話,即使被捕獲了,瀏覽器也會(huì)在這里暫停。反正是測(cè)試,忽略即可。

測(cè)試都被包在assert里面

/**
 * Support testing using an element
 * @param {Function} fn Passed the created div and expects a boolean result
 */
function assert( fn ) {
    var div = document.createElement("div");

    try {
        return !!fn( div );
    } catch (e) {
        return false;
    } finally {
        // Remove from its parent by default
        if ( div.parentNode ) {
            div.parentNode.removeChild( div );
        }
        // release memory in IE
        div = null;
    }
}

報(bào)錯(cuò)的測(cè)試樣例是

assert(function( div ) {
    // Support: Windows 8 Native Apps
    // The type and name attributes are restricted during .innerHTML assignment
    var input = doc.createElement("input");
    input.setAttribute( "type", "hidden" );
    div.appendChild( input ).setAttribute( "name", "D" );

    // Support: IE8
    // Enforce case-sensitivity of name attribute
    if ( div.querySelectorAll("[name=d]").length ) {
        rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
    }

    // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
    // IE8 throws error here and will not see later tests
    if ( !div.querySelectorAll(":enabled").length ) {
        rbuggyQSA.push( ":enabled", ":disabled" );
    }

    // Opera 10-11 does not throw on post-comma invalid pseudos
    div.querySelectorAll("*,:x");
    rbuggyQSA.push(",.*:");
});
2017年8月11日 23:07