src/page.js
function (adUnitSettings) {
        var containers = adUnitSettings.containers;

        var adContainers = [];

        for (var i = 0; i < containers.length; i++) {
            var container = containers[i];

            var containerXPath = container.xPath;
            var adContainerElements = xPath(containerXPath);

            if (!adContainerElements.length) {
                logger.warn("Ad container with xPath: \"" + containerXPath + "\" could not be found on page");
                continue;
            }

            if (adContainerElements.length > 1) {
                logger.warn("Ad container with xPath:  \"" + containerXPath + "\" has multiple matches");
            }

            adContainers.push(new AdContainer(container, adContainerElements[0]));
        }

        return adContainers;
    }
function (adUnitSettings) {
        var containers = adUnitSettings.containers;

        var adContainers = [];

        for (var i = 0; i < containers.length; i++) {
            var container = containers[i];

            var containerXPath = container.xPath;
            var adContainerElements = xPath(containerXPath);

            if (!adContainerElements.length) {
                logger.warn("Ad container with xPath: \"" + containerXPath + "\" could not be found on page");
                continue;
            }

            if (adContainerElements.length > 1) {
                logger.warn("Ad container with xPath:  \"" + containerXPath + "\" has multiple matches");
            }

            adContainers.push(new AdContainer(container, adContainerElements[0]));
        }

        return adContainers;
    }
function ( adUnitSettings ) { var containers = adUnitSettings . containers ; var adContainers = [ ] ; for ( var i = 0 ; i < containers . length ; i ++ ) { var container = containers [ i ] ; var containerXPath = container . xPath ; var adContainerElements = xPath ( containerXPath ) ; if ( ! adContainerElements . length ) { logger . warn ( "Ad container with xPath: \"" + containerXPath + "\" could not be found on page" ) ; continue ; } if ( adContainerElements . length > 1 ) { logger . warn ( "Ad container with xPath:  \"" + containerXPath + "\" has multiple matches" ) ; } adContainers . push ( new AdContainer ( container , adContainerElements [ 0 ] ) ) ; } return adContainers ; }
Gets the adcontainers on the page from the container xPath
@param adUnitSettings the settings for the adUnit to get the container of
@returns {Array.<Object>} the AdContainer object or null if not found
Gets the adcontainers on the page from the container xPath