Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

javscript code not working properly


  • Please log in to reply

#1
Dragon

Dragon

    All Around Computer Nut

  • Retired Staff
  • 2,682 posts
ok,
so I have my own affiliate banner system going on my site. I have a javascript code for running my banners which are supposed to be clickable links. But when the system is running none of the ads are clickable. Any ideas?

Here is the stripped down code, the only thing missing is the affiliate links.

<script language="JavaScript">
<!-- Begin hiding script from older browsers

// Replace the images inside the double-quotes to your own images
// You may have any number of images
adImages = new Array("image1","image2","image3")

// Replace the quotes to inside the double-quotes to your own quotes
// You may have any number of quotes but they must equal the number of images that rotate
quote = new Array("This is Image 1","This is Image 2","This is Image 3")

// Replace the quotes to inside the double-quotes to your links
adURL = new Array ("url1","url2","url2")


thisAd = 0
imgCt = adImages.length
quoteCt = quote.length

function rotate() {
  if (document.images) {
	if (document.cycle.complete) {
	  thisAd++
	  if (thisAd == imgCt && thisAd == quoteCt) {
		thisAd = 0
	  }
	  document.cycle.src = adImages[thisAd];
	  window.defaultStatus = quote[thisAd];
	}
// This sets the interval to which the images and quotes are rotated. 1000 equals 1 second
	setTimeout("rotate()", 3500)
  }
}


 function rotateLink() { window.parent.location.href = "http://" + adURL[thisAd] }


// End hiding script from older browsers -->
</script>
<body onLoad="rotate()">

<!-- Add an anchor tag to the image to call the rotateLink function of the script for links -->

<p align="center"><img src="image1" width="300" height="150" border="0" name="cycle"></p>

i won't use google adsense because, honestly, I don't trust it.

Edited by Dragon, 20 May 2006 - 11:36 AM.

  • 0

Advertisements


#2
admin

admin

    Founder Geek

  • Community Leader
  • 24,639 posts
I don't know Javascript, but I do know advertising. :blink: I'd suggest you look at PHPads, it even comes as a one click install on many hosting packages offering cPanel and Fantastico. :whistling:
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP