需要为随机图像/链接加载脚本的Javascript代码添加登录到_blank

需要为随机图像/链接加载脚本的Javascript代码添加登录到_blank,javascript,Javascript,我有一个广告旋转脚本,我在这里得到的,但它没有一行,使链接去一个空白页与家长。或者任何显示细节的地方 function randomzero (n) { return ( Math.floor ( Math.random ( )*0.9999999999999999* (n + 1)) );} //IV. assign any random number from 0 to 2 to x. x = randomzero(4); //V. display the image docume

我有一个广告旋转脚本,我在这里得到的,但它没有一行,使链接去一个空白页与家长。或者任何显示细节的地方

function randomzero (n)
{
 return ( Math.floor ( Math.random ( )*0.9999999999999999* (n + 1)) );}

//IV. assign any random number from 0 to 2 to x.

x = randomzero(4);


//V. display the image
document.write('<a href="http://' + randomlink[x] + '">');
document.write('<img alt="random ad banner"src="' + randompic[x] +   '"/>');
document.write('</a>');
函数随机零(n)
{
返回(Math.floor(Math.random()*0.9999999999999*(n+1));}
//四、 指定0到2到x之间的任意随机数。
x=0(4);
//V.显示图像
文件。写(“”);

当然可以。将
目标添加到它创建的链接中:

document.write('<a target="_blank" href="http://' + randomlink[x] + '">');
document.write(“”);