一段代码的解读
程序代码:
<script language="javascript"> rnd.today=new Date(); rnd.seed=rnd.today.getTime(); function rnd() { rnd.seed=(rnd.seed*9301+49297) % 233280; return rnd.seed/(233280.0); } function rand(number) { return Math.ceil(rnd()*number); } if (navigator.userAgent.indexOf('Safari') != -1) { var pagenumber = front1.length -1 ; var randomnumber = Math.random() ; var rand1 = rand(pagenumber); document.write(front1[rand1][2]); } else { var pagenumber = front.length -1 ; var randomnumber = Math.random() ; var rand1 = rand(pagenumber); document.write(front[rand1][2]); } </script>