General Actions:
Within the asynchronous codes, it is possible to create functions for specific Ad Server event. (Example of Ad Server event: Ad Server has / has not ad, and others.) The events are connected using „me.on“ method. Functions are connected to events as follows:
In general, “ibbAds.tag” includes events of all Ad Servers. If you need to set event for specific Ad Server you can use this writing:
Two events are actually supported by asynchronous codes. Each of them has its own unique name which has to be defined during function implementation.
Occurs when Ad Server returns in its answer one or more Ads which are recorded into specific position.
For example, we want to display "Advertisement“ caption for position in page, simultaneously we need the caption display only in case when Ad Server returns some ad (ads) to the position.
In the above example the function is assigned to ADS_WRITTEN_TO_AD_SLOT event. It means that the function will be called when Ad Server returns an ad to position in its answer. The function sets class name “isAdvertisement” for all positions into which is an ad returned.
In CSS class "isAdvertisement" caption "Advertisement" is defined through "content" as you can see on the example below:
Occurs when Ad Server returns empty response without any ad to position.
For example, take a defined position on a page with fixed dimensions which you want to hide in case that Ad Server do not have any ad to the position. You can use event NO_AD_RETURNED_FOR_AD_SLOT:
Now inline style “display= ”none” ” is set for position which do not have any ad and the position is hidden.