[Javascript] How to display two sets of rotating ads

Miles Thompson miles at allnovascotia.com
Tue Sep 27 15:06:27 CDT 2005


My client wants to display two sets of rotating ads in his daily business 
newspaper, one on each side of the central news column.

I'm presently using the Anarchos ad rotator to do so. To display a set of 
changing graphics, one puts this code at the spot where the display is wanted:

	<!-- Banner Ad code -->
	<div id="bannerAd">
	<script language="JavaScript">
	<!--
	document.write(myCode) ;
	// -->
	</script>
	</div>

I thought I could have two instances by duplicating some of the internal 
variables, including myCode, and placing similar code on the other side, 
using RightSideCode in place of myCode, etc. Didn't work - one ad got 
picked and then nothing happened.

Do I have to completely replicate the script, using different variables 
throughout, to do this? I was rather hoping to use one script, with 
different variables.

Please understand that I've been programming for nearly 20 yr: Pascal, 
FoxPro, Visual FoxPro, PHP, Visual Basic (3 thru 6), Python. I've also had 
to work with ActionScript in Flash, and JavaScript. For whatever reason, 
JavaScript I find very uncomfortable and fragile, so tend to be very 
tentative when working with it. Thus this question.

Thanks in advance - Miles Thompson





More information about the Javascript mailing list