Tech Home Publishers Advertisers
Offer List JavaScript Include for Static Sites

The purpose of this document is to explain how Partners with static HTML pages can use a JavaScript include file to dynamically display offers on their Web sites.

Note that, the JavaScript offer stream can be used for Private Label (Basic)  and (Limited) only. For information on sending orders to Aptimus see the Order Action Specification.

Partners with static HTML pages can use a JavaScript include file to dynamically display offers on their Web sites. The file points to an XSL template that transforms offer data into a JavaScript file with an OFFER_LIST object. The OFFER_LIST object can be accessed from anywhere on the HTML page by referencing it with a script.

For instance, to access the "title" of the first offer in the OFFER_LIST object, the partner could use the following line:

     document.write(document.OFFER_LIST.OFFER[0].TITLE);

A few functions have been provided to make this task easier:

getOFFERS()
This function allows the user to retrieve the entire OFFER object so it can be iterated through directly. The function returns the OFFER object under OFFER_LIST. The example below does the same thing as the previous one.

     var OFFERS = getOFFERS();
     document.write(OFFERS[0].TITLE);

The partner could also iterate through the entire OFFER object to display every title for every offer (or any other offer property):

     for ( var i = 0; i < OFFERS.length; i++ )
     {
          document.write(OFFERS[i].TITLE);
     }

In this case, there's no need to reference the exact offer number since the offer count is generated by the length of the OFFER object array.


Next

For Aptimus Publisher Use Only
©2007 All Rights Reserved
Last Updated 11/3/01