View Full Version : Question! Help Please!


Prezhi0usGurL
05-07-2003, 12:59 AM
Hi,

I was just wondering if anybody know how to add a TARGET tag on this "Random Image Links" Code.

Here's the code:

<!-- BEGIN Random Links -->
<script language="javascript">
<!--
var b1dis = "<a href=\"";
var bdis = "\"><img src=\"";
var edis = " width=\"88\" height=\"31\" alt=\"\" border=\"0\"></a>";
var rnumb = "";
var img = "";

rnumb += Math.floor(Math.random()*7);
img = rnumb;

if (img == "0") {
document.write(b1dis+ "http://www.roxydoll12.com" +bdis+ "linkage/alexabutton2.gif\"" +edis);
}

if (img == "1") {
document.write(b1dis+ "http://www.tennyo.net/pixels" +bdis+ "linkage/tennyo.gif\"" +edis);
}

if (img == "2") {
document.write(b1dis+ "http://www.dduckeez.com" +bdis+ "linkage/dduckeez.gif\"" +edis);
}

if (img == "3") {
document.write(b1dis+ "http://www.angelic-network.com" +bdis+ "linkage/angelicv15.gif\"" +edis);
}

if (img == "4") {
document.write(b1dis+ "http://www.pinoy7.com" +bdis+ "linkage/pinoy7.gif\"" +edis);
}

if (img == "5") {
document.write(b1dis+ "http://www.magitek-designs.net" +bdis+ "linkage/magitek.gif\"" +edis);
}

if (img == "6") {
document.write(b1dis+ "http://www.lissaexplains.com" +bdis+ "linkage/lissaexplains.gif\"" +edis);
}


// -->
</SCRIPT>
<!-- END Random Links -->


I have that in a frame and I tried to click on the link and the link opened on that frame.. I dont know how to put a target tag on this one. Can somebody help me please? Thanks alot!



Love Lots,
Kaisy

Greeno
05-07-2003, 01:05 AM
So mainly your saying that the links are opening inside your iframe.. but you want the to open into a new window?

Prezhi0usGurL
05-07-2003, 02:15 AM
yes. I want the link to open into a new window.

Dude128
05-07-2003, 04:16 AM
try changing each link to this general format:

if (img == "0") {
document.write(b1dis+ "http://www.roxydoll12.com" +bdis+ "linkage/alexabutton2.gif\" target=\"_blank\"" +edis);
}

Prezhi0usGurL
05-07-2003, 11:10 PM
Hi,

I tried adding that to each link but it still shows up in the frame. Im sorry. Thanks anyways.


Take Care,
Kaisy

pb&j
05-07-2003, 11:16 PM
try changing this...
var b1dis = "<a href=\"";

to this...
var b1dis = "<a target=\"_blank\" href=\"";

Prezhi0usGurL
05-07-2003, 11:40 PM
Thanks alot. It worked now. I changed the var b1dis = "<a href=\""; to var b1dis = "<a target=\"_blank\" href=\"";
Thank you so much!


Love Lots,
Kaisy