lib/traits/common.php
public function isAjax()
    {
        if (
            strlen($this->arParams['AJAX_COMPONENT_ID']) > 0
            && strlen($this->arParams['AJAX_PARAM_NAME']) > 0
            && $_REQUEST[$this->arParams['AJAX_PARAM_NAME']] === $this->arParams['AJAX_COMPONENT_ID']
            && isset($_SERVER['HTTP_X_REQUESTED_WITH'])
            && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'
        )
        {
            return true;
        }

        return false;
    }
public function isAjax()
    {
        if (
            strlen($this->arParams['AJAX_COMPONENT_ID']) > 0
            && strlen($this->arParams['AJAX_PARAM_NAME']) > 0
            && $_REQUEST[$this->arParams['AJAX_PARAM_NAME']] === $this->arParams['AJAX_COMPONENT_ID']
            && isset($_SERVER['HTTP_X_REQUESTED_WITH'])
            && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'
        )
        {
            return true;
        }

        return false;
    }
public function isAjax ( ) { if ( strlen ( $ this -> arParams [ 'AJAX_COMPONENT_ID' ] ) > 0 && strlen ( $ this -> arParams [ 'AJAX_PARAM_NAME' ] ) > 0 && $ _REQUEST [ $ this -> arParams [ 'AJAX_PARAM_NAME' ] ] === $ this -> arParams [ 'AJAX_COMPONENT_ID' ] && isset ( $ _SERVER [ 'HTTP_X_REQUESTED_WITH' ] ) && strtolower ( $ _SERVER [ 'HTTP_X_REQUESTED_WITH' ] ) === 'xmlhttprequest' ) { return true ; } return false ; }
Is AJAX request

@return bool
Is AJAX request