jQuery 1.0.4 - New Wave Javascript(js源文件)

2019-06-03 09:49:42刘景俊

            "!=": "z!=m[4]",
            "^=": "z && !z.indexOf(m[4])",
            "$=": "z && z.substr(z.length - m[4].length,m[4].length)==m[4]",
            "*=": "z && z.indexOf(m[4])>=0",
            "": "z"
        },
        "[": "jQuery.find(m[2],a).length"
    },

    token: [
        "..|/..", "a.parentNode",
        ">|/", "jQuery.sibling(a.firstChild)",
        "+", "jQuery.sibling(a).next",
        "~", function(a){
            var s = jQuery.sibling(a);
            return s.n >= 0 ? s.slice(s.n+1) : [];
        }
    ],

    find: function( t, context ) {
        // Make sure that the context is a DOM Element
        if ( context && context.nodeType == undefined )
            context = null;

        // Set the correct context (if none is provided)
        context = context || document;

        if ( t.constructor != String ) return [t];

        if ( !t.indexOf("//") ) {
            context = context.documentElement;
            t = t.substr(2,t.length);
        } else if ( !t.indexOf("/") ) {
            context = context.documentElement;
            t = t.substr(1,t.length);
            // FIX Assume the root element is right :(