ランダムにバナー画像を表示して新規ページにリンク



0   名前: netapple : 2006/05/09(火) 16:15
「ランダムにバナー画像を表示する」JavaScriptをリンクのターゲットを新規ページにしたいのですが、どこに入れても出来ません
どのようにしたらよいのでしょうか?

<html>
<head>
<title>ランダムにバナー画像を表示する</title>
</head>
<body>
<script language="JavaScript"><!--
jumpURL = new Array();
imgURL = new Array();
jumpURL[0] = "http://www.shiojiri.ne.jp/~openspc/";
jumpURL[1] = "http://game.gr.jp/;
imgURL[0] = "banner/0.gif";
imgURL[1] = "banner/1.gif";

n = Math.floor(Math.random()*jumpURL.length);
document.write("<a href='"+jumpURL[n]+"'>");
document.write("<img src='"+imgURL[n]+"' border='0'>");
document.write("</a>");
// --></script>
</body>
</html>

1   名前: かわうそ : 2006/05/09(火) 16:15
document.write("<a href='"+jumpURL[n]+"'>");

document.write("<a href='"+jumpURL[n]+"' target='_blank'>");

こういうことですか?

2   名前: netapple : 2006/05/09(火) 16:15  ID:T0tUexUV
ありがとうございました。
新規ページに出ました!

一覧へ戻る