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
NativeAdsfor 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.readyfires. Thus, this callback function usually should not be provided, unless there are very specific performance concerns with waiting forjQuery.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 forceboolean <optional>
false If the plugin has already been initialized, then setting this to
trueforces yourNativeAds#onReadycallback to run again.If the plugin has not already been initialized, then setting this to
falseor 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 adsAPI Object that implements the
APIinterface. -
NativeAdsReadyWhenCallback(go)
-
Callback for
NativeAds#readyWhen.Parameters:
Name Type Description gofunction Function that should be called when the plugin is ready to begin execution.