<div class="htmlarea"> <textarea id="runcode64190"> <script> alert(new Date().getTime())</script> </textarea><br><input onclick="runEx('runcode64190')" type="button" value="运行代码"> <input onclick="doCopy('runcode64190')" type="button" value="复制代码"> <input onclick="doSave(runcode64190)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div> <br>(new Date().getTime()) ^ Math.random(); <br><br>随机且基本上很难重复……<br>那不如这样算了。。随机生成不重复的数字,并且还从大到小排列。。<br><div class="htmlarea"> <textarea id="runcode55904"> <script> function create(n) { var temp=Math.floor(Math.random()*10+n*10); while(--n!=0) { return temp+","+create(n); } if(n==0) { return temp; } } alert(create(10)); </script> </textarea><br><input onclick="runEx('runcode55904')" type="button" value="运行代码"> <input onclick="doCopy('runcode55904')" type="button" value="复制代码"> <input onclick="doSave(runcode55904)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div>