Wait until jQuery AJAX requests complete before checking page