gleenk
9/23/2015 - 9:52 AM

Check if ajax is active

Check if ajax is active

function isAjax() {
    return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && 
        ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'));
}

if(!isAjax()):
endif;