gpt4 book ai didi

javascript - 在 JSLint 中,为什么这个 block 是空的?

转载 作者:行者123 更新时间:2023-11-29 16:18:16 26 4
gpt4 key购买 nike

<分区>

我在使用 JSLint 时遇到了一些困难。我有以下代码:

// inside a for-loop
if ( aMatch.length > 0 ){
temp = wrap.find( aMatch );
break;
} else if ( aMatch.length === 0 && o.siteMap[targetPath].length !== 0 ){
temp = targetPath;
break;
}

JSLint 提示:

Empty block   "if ( aMatch.length > 0 ){"

问题:
片段有什么问题。 “ block ”对我来说不是空的......

感谢您提供一些见解!

编辑:
这是问题中的整个功能(没有评论)

loopHistory: function (scope, setPageContainer) {

var self = this,
o = self.options,
wrap = $('div:jqmData(wrapper="true")').length > 1 ? $('div:jqmData(wrapper="true")').last() : $('div:jqmData(wrapper="true")'),
$loopLength = $.mobile.urlHistory.stack.length-1,
temp, aMatch, parsedPath, dUrl, targetPath, i;

if ( scope === "internal") {
if ( $loopLength >= 2) {

for ( i = $loopLength; i>1; i--) {
parsedPath = $.mobile.path.parseUrl( $.mobile.urlHistory.stack[i-1].url );
targetPath = parsedPath.search.length !== "" ? ( parsedPath.pathname + parsedPath.search ) : parsedPath.pathname;

if ( setPageContainer.jqmData('id') === $.mobile.urlHistory.stack[i-1].pageContainer.jqmData('id') && targetPath !== $.mobile.path.parseUrl( $.mobile.urlHistory.stack[$.mobile.urlHistory.activeIndex].pageUrl ).pathname ) {

aMatch = $('div.ui-page').filter(function(){ return $(this).jqmData('url') === targetPath; });

if ( aMatch.length === 0 && o.siteMap[targetPath].length !== 0 ){

}

... ahh yes....
if ( aMatch.length > 0 ){
temp = wrap.find( aMatch );
break;

好的。我明白了……

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com