If you haven't already, please read the Ads 2.0 Solution Architecture document to get a high-level overview of what the tool is and how to use it. This document will tell you what the tool's dependencies are, how to insert it into a web page, how to control it once the page has been loaded into a browser, and how to debug errors.
In the <head> of the web page, insert script calls to the following two libraries in this order:
<script src="/common/scripts/EventBroadcaster.js" type="text/javascript"></script>
<script src="/components/AdController/Ads2.js" type="text/javascript"></script>
We'll need to determine the correct host name to use for these calls, but it might be image.weather.com.
Next, determine the ad positions on the page, hopefully from the adinfo.properties file for JSPs or the ad include for static pages, and then set the positions. This should also be inside the <head>, but it doesn't have to be. It's just safest to put it there so that events happen in the correct sequence.
<script type="text/javascript">
Ads2.setPositions(['Leader1','Skyscraper','Hidden1','Hidden2']);
</script>
Last, you need to place the ads on the page. This is normally where we call OAS_RICH for the ads. The adPosition method draws an iframe into the page at that exact position for that ad position. Here's how to do it:
<script>Ads2.addPosition('Leader1');</script>
Make sure you place all of the positions that were defined by setPositions above or else the library will throw an error and not make the ad call. This is intentional so that the developer will know that there is an error, and so that we don't deploy a web page that calls an ad position but then doesn't place it on the page. The addPosition calls can be made into absolutely-positioned DIVs, if you wish; they just can't be added to the page in this manner after the page has already loaded since the library uses document.write to place the iframe tags into the page.
When the page had loaded, the library will automatically make the first ad call. It waits this long in order to ensure that all of the iframes that we will use will be populated into the DOM.
The primary call you can make after the page has been loaded is Ads2.reload() in order to refresh all of the ads on the page. Something else you could do is call Ads2.setTarget(newSpoof), which will change the spoof being used and then refresh all of the ads on the page.
The Ads2.js library collects error messages, if thrown, until the page loads. After that, it passes all of the error messages it has collected to the wxtools.logs property. You can view the contents of that property by entering "javascript:alert(wxtools.logs)" into the browser address bar and pressing [Enter]. While primitive, it should be good enough for catching any errors without being too intrusive or disruptive of the user experience.