Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

javscript code not working properly

  • Please log in to reply



    All Around Computer Nut

  • Retired Staff
  • 2,682 posts
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) {
	  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 -->
<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




    Founder Geek

  • Community Leader
  • 24,575 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