|
I need js to produce a link to random page on website that can also display in new window. and if possible control is size and shape to hold just the image.
currently effectively using (but is not new window):
i<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function go_to(url) {
window.location=url;
}
function rand_link() {
var a;
a = 1+Math.round(Math.random()*22); // a = random number between 1-22
if (a==1) go_to("image URL");
if (a==2) go_to("image URL");
if (a==3) go_to("image URL");
if (a==4) go_to("image URL");
if (a==5) go_to("image URL");
if (a==6) go_to("image URL");
and so on up to 22
}
// End -->
</SCRIPT>
<BODY>
<CENTER>
<FORM NAME="myForm">
<INPUT TYPE="button" NAME="myButton" VALUE="Pick a Card"
onClick="rand_link()">
</FORM>
</CENTER>
works great but how can i make any of the random links open in new window?
thanks.
|