我可以根据 javascript 中的 if/else 语句更改变量值吗?
var $nextLink = $this.next().attr('href'),
$currentLink = $this.attr('href');
if ($currentLink == $nextLink){ // Check if next link is same as current link
var $nextLoad = $this.eq(2).attr('href'); // If so, get the next link after the next
}
else {var $nextLoad = $nextLink;}