function existDuo(a, t){
for(var i in a)
if(a[i]==t)
return true
return false
}
var a=[]
while(a.length<6){
var t=Math.floor(Math.random()*50+1)
if(!existDuo(a,t)) a.push(t)
}
for(var i in a)
document.write('<li><img src="'+a[i]+'.jpg"></li>\n')
</script>
var arr=["1.jpg","2.jpg","3.jpg","4.jpg".......]var oImg=Math.floor(Math.random()*arr.length) //随机图
img.src="./img/"+arr[oImg] //img元素得到img文件夹下面的某张图片
id=(1000+parseInt(Math.random()*500)*1).toString().substr(1)document.write("<a href='" + id +".html'><img src='./PicShow/" + id + ".gif'></a>")