S
SandyTipper
I thought this was a trivial bit of code, but it doesn't seem to work.
Anybody wlling to help?
I create a simple one-row html table, and insert a javascript piece
between the <tr> and </tr>, which should use document.write to
create three columns to display random ads for my site's sponsors.
<P align=center>
<TABLE style="BORDER-BOTTOM: #999999 1px solid; BORDER-LEFT: #999999 1px
solid; MARGIN: 1px; BORDER-COLLAPSE: collapse; BORDER-TOP: #999999 1px
solid; BORDER-RIGHT: #999999 1px solid" class=contStyleExcSimpleTable
cellSpacing=0 cellPadding=3 width="97%" bgColor=#ffffff align=left>
<TBODY>
<TR><script type="text/javascript">
var myAds=[]; //will contain the ads
// Edit here: Put the cell contents in myAds elements
myAds[0]='<H3>Hair Spa</H3><blockquote>ad content</blockquote>';
myAds[1]='<H3>This Space for Rent</H3>';
myAds[2]='<H3>Ads: $35/year</H3>';
myAds[3]='<H3>Your Ad Here</H3>';
// End of editing
var myCell=[]; // random indexes into myAds; 3 elements
myCell[0]=Math.floor(Math.random()*myAds.length);
do {
myCell[1]=Math.floor(Math.random()*myAds.length);
} while (myAds.length > 2 && myCell[1] != myCell[0]);
do {
myCell[2]=Math.floor(Math.random()*myAds.length);
} while (myAds.length > 2 && myCell[2] != myCell[0] && myCell[2] !=
myCell[1]);
for (var i=0; i<3; i++){
document.write('<TD style="width: 33%;VERTICAL-ALIGN: top;">';
document.write(myAds[myCell]);
document.write('</TD>');
}
</script></TR></TBODY></TABLE></P>
Anybody wlling to help?
I create a simple one-row html table, and insert a javascript piece
between the <tr> and </tr>, which should use document.write to
create three columns to display random ads for my site's sponsors.
<P align=center>
<TABLE style="BORDER-BOTTOM: #999999 1px solid; BORDER-LEFT: #999999 1px
solid; MARGIN: 1px; BORDER-COLLAPSE: collapse; BORDER-TOP: #999999 1px
solid; BORDER-RIGHT: #999999 1px solid" class=contStyleExcSimpleTable
cellSpacing=0 cellPadding=3 width="97%" bgColor=#ffffff align=left>
<TBODY>
<TR><script type="text/javascript">
var myAds=[]; //will contain the ads
// Edit here: Put the cell contents in myAds elements
myAds[0]='<H3>Hair Spa</H3><blockquote>ad content</blockquote>';
myAds[1]='<H3>This Space for Rent</H3>';
myAds[2]='<H3>Ads: $35/year</H3>';
myAds[3]='<H3>Your Ad Here</H3>';
// End of editing
var myCell=[]; // random indexes into myAds; 3 elements
myCell[0]=Math.floor(Math.random()*myAds.length);
do {
myCell[1]=Math.floor(Math.random()*myAds.length);
} while (myAds.length > 2 && myCell[1] != myCell[0]);
do {
myCell[2]=Math.floor(Math.random()*myAds.length);
} while (myAds.length > 2 && myCell[2] != myCell[0] && myCell[2] !=
myCell[1]);
for (var i=0; i<3; i++){
document.write('<TD style="width: 33%;VERTICAL-ALIGN: top;">';
document.write(myAds[myCell]);
document.write('</TD>');
}
</script></TR></TBODY></TABLE></P>