Hello! I am new to the board and I have a question. I am giving myself a serious headache with this and I am hoping you know how to help. I got the following code from this site and I need it altered just a tad and I am unable to do it correctly. This code is for Random Link display. I need it to open in a NEW window instead of taking visitors away from my site.
Please Help!
<script>
<!--
/*
Random link button- By JavaScript Kit (http://javascriptkit.com)
Over 300+ free scripts!
This credit MUST stay intact for use
*/
//specify random links below. You can have as many as you want
var randomlinks=new Array()
randomlinks[0]="http://freewarejava.com"
randomlinks[1]="http://javascriptkit.com"
randomlinks[2]="http://dynamicdrive.com"
randomlinks[3]="http://cnn.com"
randomlinks[4]="http://www.geocities.com"
function randomlink(){
window.location=randomlinks[Math.floor(Math.random()*randomlinks.length)]
}
//-->
</script>
<form>
<p><input type="button" name="B1" value="Mystery Links!" onclick="randomlink()"></p> </form>
<!--Uncomment below to use a regular text link instead
<a href="javascript:randomlink()">Random Link</a>
-->
Please Help!
<script>
<!--
/*
Random link button- By JavaScript Kit (http://javascriptkit.com)
Over 300+ free scripts!
This credit MUST stay intact for use
*/
//specify random links below. You can have as many as you want
var randomlinks=new Array()
randomlinks[0]="http://freewarejava.com"
randomlinks[1]="http://javascriptkit.com"
randomlinks[2]="http://dynamicdrive.com"
randomlinks[3]="http://cnn.com"
randomlinks[4]="http://www.geocities.com"
function randomlink(){
window.location=randomlinks[Math.floor(Math.random()*randomlinks.length)]
}
//-->
</script>
<form>
<p><input type="button" name="B1" value="Mystery Links!" onclick="randomlink()"></p> </form>
<!--Uncomment below to use a regular text link instead
<a href="javascript:randomlink()">Random Link</a>
-->
Comment