谢谢大家了!已经搞出来了!
但是有几个问题
*.jpg 的图片好象不能显示,我把他换成*.gif 就ok了,不知是怎么会事。
我写的如下
var imgSrc,imgW,imgW, r,Plength;
r=1;
imgW=183;
imgH=150;
Plength=10;
r = randomNumber(Plength);
//document.write(r);
if (r==0) document.write('

');
if (r==1) document.write('

');
if (r==2) document.write('

');
if (r==3) document.write('

');
if (r==4) document.write('

');
if (r==5) document.write('

');
if (r==6) document.write('

');
if (r==7) document.write('

');
if (r==8) document.write('

');
if (r==9) document.write('

');
function randomNumber(limit)//生成随机数
{ return Math.floor(Math.random()*limit);//math.floor生成0-1的随机数
}