I have function that add to div container div’s
$.ajax(
{
type: "GET",
url: "/LoadedData",
data: { "pageNumber": pageNumber },
success: function (result) {
$('.Container').append(result);
}
}
and I want to execute that function until this div container contains div with is xxx
I try to do this with while loop but is looks like when i do :
while($('.Container div').is('#xxx'))
{}
function not see new div’s appended to Container :/
Place your code in a function that is recursively called in the
callback:if theresultdid not match your selector.It will continue to run until the selector is matched.