hey guys,
var check;
function showLoader() {
$('#mc_signup_form').prepend('<span class="loading"> loading …</span>');
check_init();
}
function check_init() {
check = setInterval('check_trigger()', 300);
}
function check_clear() {
clearInterval(check);
}
function check_trigger() {
if ( $('.mc_error_msg').length == 0 || $('.mc_success_msg').length == 0 ) {
$('#mc_signup_form .loading').remove();
check_clear();
}
}
i wonder why my browser keeps telling me that check_trigger() doesn't exist? I'm initiating a setInterval inside of my showLoader() function. It should trigger check_trigger. When one of the two divs (.mc_error_msg or .mc_success_msg) exists i want to clear the Interval.
What am I doing wrong?