remove duplicates

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

remove duplicates

Post by Vegan »

Code: Select all

var outlist = [];

function showads(number) {
	for (i=0; i<number; i++) {
		temp = '<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=cpa07-20&o=1&p=8&l=as4&m=amazon&f=ifr&ref=ss_til&asins=';
		temp += amazonads[Math.floor(Math.random()*amazonads.length)];
		temp += '" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>';
		document.write(temp);
	}
}
what I am considering is a strategy to feed outlist one way or another so that it contains the number of ads intended and is free of duplication for a given invocation which may occur more than once depending on the document its used on

the main array is simply the Amazon ASINS code for the game ad being shown, the script simply pastes it all together
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Post Reply