Maison >interface Web >js tutoriel >这也算是一个订单生成方式
<!doctype html> <html> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>Document</title> <script type="text/javascript"> getDataId=function(){return new Date().getTime()+getRandomNum(1,10,3) //return new Date().getTime()//return getRandomNum(1,10,3);}; getRandomNum=function(a,e,k){ var h=""; for(var c=0;c<k;c++) { var f=e-a;var b=Math.random(); h+=(a+Math.round(b*f)) } return h }; function aa(){ document.getElementById('aaa').value=getDataId(); } </script> </head> <body> <input type='button' value="点击" onclick="aa();"> <input type='text' value='' id="aaa"/> </body> </html>