-
jQuery源码分析-jQuery中的循环技巧
- 作者:nuysoft/JS攻城师/高云 QQ:47214707 EMail:nuysoft@gmail.com
- 声明:本文为原创文章,如需转载,请注明来源并保留原文链接。
- 前记:本文收集了jQuery中出现的各种遍历技巧和场景
- for ( type in events ) {
-
- }
- for ( var j = 0, l = handlers.length; j < l; j++ ) {
-
- }
- var elem;
- for ( var i = 0; elems[i]; i++ ) {
- elem = elems[i];
-
- }
- for ( j = 0; j < eventType.length; j++ ) {
- eventType.splice( j--, 1 );
- }
- for ( var i = 1; i < results.length; i++ ) {
- if ( results[i] === results[ i - 1 ] ) {
- results.splice( i--, 1 );
- }
- }
- for ( j = pos || 0; j < eventType.length; j++ ) {
-
- }
- for ( var i = this.props.length, prop; i; ) {
- prop = this.props[ --i ];
- event[ prop ] = originalEvent[ prop ];
- }
- for ( j = tbody.length - 1; j >= 0 ; --j ) {
- if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
- tbody[ j ].parentNode.removeChild( tbody[ j ] );
- }
- }
- for ( i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
- results.push( set[i] );
- }
- }
- for ( ; array[i]; i++ ) {
- ret.push( array[i] );
- }
- for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
-
- }
- for ( node = parent.firstChild; node; node = node.nextSibling ) {
- if ( node.nodeType === 1 ) {
- node.nodeIndex = ++count;
- }
- }
- for ( ; cur; cur = cur[dir] ) {
- if ( cur.nodeType === 1 && ++num === result ) {
- break;
- }
- }
- var i = promiseMethods.length;
- while( i-- ) {
- obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
- }
- while( (type = types[ i++ ]) ) {
-
- }
- while( dataTypes[ 0 ] === "*" ) {
- dataTypes.shift();
- if ( ct === undefined ) {
- ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
- }
- }
- while( callbacks[ 0 ] ) {
- callbacks.shift().apply( context, args );
- }
- while( ( match = rheaders.exec( responseHeadersString ) ) ) {
- responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
- }
-
相关阅读:
uni-app-数据缓存
uni-app-网络请求
uni-app-上拉加载
uni-app-下拉刷新
uni-app-生命周期
uni-app字体图标
uni-app-样式
[Python] ValueError: Unknown resampling filter
[Python]列表复制以及切片[:][::]解析
LeetCode 29. 两数相除
-
原文地址:https://www.cnblogs.com/xiaochao12345/p/3822300.html
Copyright © 2020-2023
润新知