html target in Javascript?

They have: 59 posts

Joined: Mar 2000

Hi, I'm using the following script to create a cycle of banners on my website:

<script LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
<!-- Hide script from old browsers

adImages = new Array("ads/cchbanner.gif","ads/afsa-spot-cl1.jpg","ads/afsa-spot-cl2.jpg","ads/wellsfargo.gif")
adURL = new Array("http://onlinestore.cch.com/productList.asp?SessionID=29300&BU=bfg&Cat=67&Home=http://business.cc","http://www.creditcompliance.com/afsa","http://www.creditcompliance.com/afsa","http://www.wellsfargo.com")
thisAd = 0
imgCt = adImages.length

function rotate() {
if (document.images) {
if (document.adBanner.complete) {
thisAd++
if (thisAd == imgCt) {
thisAd = 0
}
document.adBanner.src=adImages[thisAd]
}
  setTimeout("rotate()", 3 * 1000)
  }
}

function newLocation() {
parent.location.href = adURL[thisAd]
}

// End hiding script from old browsers -->
&lt;/script&gt;
'

For the URLs that I'm linking to, I want to add something that is the equivalent of the HTML phrase target="_blank" so that they open in a new window. I've tried just adding that HTML into the URL, but it doesn't work. I can't add it into the parent.location.href line because I don't know a JavaScript equivalent way to say target="_blank".

I'm sorry if this question is elementary, but I'd appreciate any help!

Thanks, Phyllis

They have: 488 posts

Joined: Feb 2000

Try for example in your script

newWindow=window.open("http://onlinestore.cch.com/productList.asp?SessionID=29300&BU=bfg&Cat=67&Home=http://business.cc","http://www.creditcompliance.com/afsa","http://www.creditcompliance.com/afsa","http://www.wellsfargo.com")

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

function newLocation() {
window.open(adURL[thisAd],'ad')
}

with the last arguement left out, the window will be a normal window. If you want to control the atmosphere, just add the last arguement...

Mark Hensler
If there is no answer on Google, then there is no question.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.