这也算是一个订单生成方式

<!doctype html>
<html lang="en">
 <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>

 

<!doctype html> <html lang="en">  <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>

猜你喜欢

转载自huihui0371.iteye.com/blog/2339427