S
SunBum
Hey all,
I need a one page html file that displays banner ads.
I use OpenX to return an array of 10 banner ads.
I need to do a couple of things with this array.
1) Make the initial "call" to OpenX that returns an array of ads.
check returned array for length and if less than 10 items are
contained, fill out the array with static ads from a local directory,
say ".\HouseAds into the array.
2) loop for 1 to 10 and display the ad in index number of loop
3) delay some time, say 30 seconds
4) next loop
5) when end of array reached, call #1 above and repeat.
I need to do this without a page refresh.
Here is sample code I have thus far:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Example usage of Single Page Call tags </title>
*****-(The following is the Array structure)-****
<script type='text/javascript'><!--// <![CDATA[
var OA_zones = {
'zone_one_1' : 1,
'zone_one_2' : 1,
'zone_one_3' : 1,
'zone_one_4' : 1,
'zone_one_5' : 1,
'zone_one_6' : 1,
'zone_one_7' : 1,
'zone_one_8' : 1,
'zone_one_9' : 1,
'zone_one_10' : 1
}
// ]]> --></script>
*****-(The following is the call to OpenX that returns Array of Ads)-
****
<script type='text/javascript' src='http://www.mydomain.com/openx/www/
delivery/spcjs.php?id=1&block=1&withtext=1'></script>
*****-(check len of array returned and if less than 10,
load as many as needed to fill out array from
local dir ".\houseAds))-****
</head>
<body>
*****-(The following is an example of how each ad is called. There
will be just one
QA call with "OA_show('zone_one_#')" where # is the number
from loop)-****
*****-(Begin Loop through Array Here)-****
<script type='text/javascript'><!--// <![CDATA[
OA_show('zone_one_#');
// ]]> --></script>
*****-(delay here say 30 seconds)-****
*****-(Next)-****
*****-(End loop Here)-****
*****-(Go back to start with fetch call to OpenX)-****
</body>
</html>
I hope this makes sense ...
Thanks for any help!
Mike
I need a one page html file that displays banner ads.
I use OpenX to return an array of 10 banner ads.
I need to do a couple of things with this array.
1) Make the initial "call" to OpenX that returns an array of ads.
check returned array for length and if less than 10 items are
contained, fill out the array with static ads from a local directory,
say ".\HouseAds into the array.
2) loop for 1 to 10 and display the ad in index number of loop
3) delay some time, say 30 seconds
4) next loop
5) when end of array reached, call #1 above and repeat.
I need to do this without a page refresh.
Here is sample code I have thus far:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Example usage of Single Page Call tags </title>
*****-(The following is the Array structure)-****
<script type='text/javascript'><!--// <![CDATA[
var OA_zones = {
'zone_one_1' : 1,
'zone_one_2' : 1,
'zone_one_3' : 1,
'zone_one_4' : 1,
'zone_one_5' : 1,
'zone_one_6' : 1,
'zone_one_7' : 1,
'zone_one_8' : 1,
'zone_one_9' : 1,
'zone_one_10' : 1
}
// ]]> --></script>
*****-(The following is the call to OpenX that returns Array of Ads)-
****
<script type='text/javascript' src='http://www.mydomain.com/openx/www/
delivery/spcjs.php?id=1&block=1&withtext=1'></script>
*****-(check len of array returned and if less than 10,
load as many as needed to fill out array from
local dir ".\houseAds))-****
</head>
<body>
*****-(The following is an example of how each ad is called. There
will be just one
QA call with "OA_show('zone_one_#')" where # is the number
from loop)-****
*****-(Begin Loop through Array Here)-****
<script type='text/javascript'><!--// <![CDATA[
OA_show('zone_one_#');
// ]]> --></script>
*****-(delay here say 30 seconds)-****
*****-(Next)-****
*****-(End loop Here)-****
*****-(Go back to start with fetch call to OpenX)-****
</body>
</html>
I hope this makes sense ...
Thanks for any help!
Mike