function newLocation() {
document.location.href = "http://www." + adURL[thisAd];
return false;
The new function
newLocation sets the
document.location.href object (in other words, the current document window) to the value of the text string
http://www. (notice the period), plus the value of
adURL. Since
adURL is an array, you need to specify which member of the array. That's stored in
thisAd, and the resulting string can be any of the three links, depending on when the user clicks. Last, it returns false, which tells the browser that it should
not also load in the
href. Otherwise, the browser would do both. We've handled everything within JavaScript, so the
HRef doesn't need to be loaded.