.once()
ad.once(events)
ad.once(events)Attach a handler to an event for the ad or elements. The handler is executed at most once per ad or element per event type.
ad.once("render", function() {
//run only once when the ad renders
});
Arguments
| Arugment | Value | Example Value | Description |
|---|---|---|---|
events | string | render | One or more space-separated event types and optional namespaces, such as "click" or "alter:adVisible" |
callback | function | function() {( //callback code )}; | A function to execute at the time the event is triggered. |
Updated less than a minute ago
