私の状況に適したイベントを作成してください。私はカウンターなし、はそれを行うには 真の方法があると信じている(このような:How to know when all ajax calls are complete)いくつかのAjax呼び出しが完了した後にトリガーされたイベントを作成するには?
HTML:
<ul id="links">
<li><a href="1.html">What is Yoda's first name?</a></li>
<li><a href="2.html">Why does Padme die?</a></li>
<li><a href="3.html">Who is Darth Rage?</a></li>
</ul>
<div id="content"></div>
のjQuery:
$('#links a').each(function (index, el) {
url = $(el).attr('href');
$('<div class="article" />').appendTo('#content')
.load(url, function(){
filterOneArticle(this);
});
});
// I want this function run after all articles will be loaded and filtered
$.bind('yepAllArticlesHaveBeenLoaded', filterAllArticles);
filterAllArticles = function() {};
filterOneArticle = function(el) {};
ありがとう、今私はカウンターを除いて方法がないと確信しています。 –