Namespace: NativeAds

NativeAds

This is the Script Mode interface used by the NATIVEADS global.

Normally, your script will initialize NATIVEADS to an empty object if it does not already exist. Then, set the onReady callback, which will give you a variable that exposes the API interface.

window.NATIVEADS = window.NATIVEADS || {};
window.NATIVEADS.injectedAt = new Date().getTime();
window.NATIVEADS.onReady = function(ads) {
  ads.setPropertyID("NA-TEST-11235814");
};

Members

injectedAt :number

The time stamp when your script loaded the plugin.

See NativeAds for an example of how you would set this.

Type:
  • number

onReady :NativeAds.NativeAdsOnReadyCallback

Callback that will run after the plugin has loaded.

Type:

readyWhen :NativeAds.NativeAdsReadyWhenCallback

Callback function that determines when the plugin should begin executing. The default implementation is suitable for most applications, and simply defers execution until jQuery.ready fires. Thus, this callback function usually should not be provided, unless there are very specific performance concerns with waiting for jQuery.ready.

Type:

<readonly> version :string

The version of the MediaVoice plugin. Available after the plugin has loaded.

Type:
  • string

Methods

exec(force)

Initialize the plugin.

This function runs automatically, and you will not normally need to call it.

Parameters:
Name Type Argument Default Description
force boolean <optional>
false

If the plugin has already been initialized, then setting this to true forces your NativeAds#onReady callback to run again.

If the plugin has not already been initialized, then setting this to false or omitting it will initialize the plugin. Normally this happens automatically and your script should never call this function this way.

Type Definitions

NativeAdsOnReadyCallback(ads)

Callback for NativeAds#onReady.

Parameters:
Name Type Description
ads API

Object that implements the API interface.

NativeAdsReadyWhenCallback(go)

Callback for NativeAds#readyWhen.

Parameters:
Name Type Description
go function

Function that should be called when the plugin is ready to begin execution.

Copyright © 2013–2017 Polar Mobile Group Inc.
Documentation generated by JSDoc 3.6.6 on Fri Sep 20 2024 16:46:55 GMT-0400 (Eastern Daylight Time) using the DocStrap template.