Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "nitroAds"

Index

Classes

Functions

Functions

createAd

  • Creates an ad placement.

    remarks

    The id used for a placement must be unique on the page it appears, and should be a stable identifier for the ad placement. Randomized values should not be used for id.

    example
    // basic usage
    window.nitroAds.createAd('banner-1', {
        sizes: [[728, 90]],
    });
    example
    // you can wrap with Promise.resolve to handle case where return may be a promise or not
    Promise.resolve(window.nitroAds.createAd('banner-1', {})).then((ad) => {
        // now save ad object for later use
    });
    example
    // you can also just use await in an async function
    let ad = await window.nitroAds.createAd('banner-1', {});

    Parameters

    • id: string

      The id for the placement. For most placement types, this should be the id of a div that the ad will fill.

    • options: NitroAdOptions

      The options object containing settings for the placement.

    Returns NitroAd | Promise<NitroAd> | Promise<NitroAd[]> | null

    Depending on loading state, this may return a promise or an object.

stop

  • stop(): void
  • Disable ad refresh on current page, for debugging.

    Returns void

Generated using TypeDoc