The following example embeds an ad into an HTML page when the link is clicked. The convenience methods Lat49.initAds() and Lat49.updateAdByLatLon() are used to set up and fetch the ad. The ad is appended within the DIV named "adcontainer".
Example 3-5. Simple Embedded Ad
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Lat49Test</title>
<META NAME="description" CONTENT="A web site that tests the Lat49 client API.">
<!-- Include the Lat49 API script. -->
<script type='text/javascript' src='http://adserver.lat49.com/lat49/v0.10/lat49.js'>
</script>
</head>
<!-- Initialize the Lat49 API on loading the body.
The following publisher ID of '12345' should be replaced
by the proper value for a publisher's site. -->
<body onload = "Lat49.initAds('12345')">
<h2> Simple Lat49 test. </h2>
<p>
<!-- Fetch the ad when the link is clicked. -->
Click the
<a href="javascript:Lat49.updateAdByLatLon('adcontainer',85.051,-179.999,16)">
link</a> to see the ad for tile (0,0,16):
</p>
<div id="adcontainer" style="width:242px; height:133px; position:relative"></div>
</body>
</html> |