风故故,也依依

Stand still in the wind.

导航

Javascript生成GUID

<script type="text/javascript">
function newGuid()
{
    var guid = "";
    for (var i = 1; i <= 32; i++) {
      var n = Math.floor(Math.random()*16.0).toString(16);
      guid +=   n;
      if((i==8)||(i==12)||(i==16)||(i==20))
        guid += "-";
    }
    return guid;   
}
</script>

 

posted on 2011-06-01 21:06  jadmin  阅读(121)  评论(0编辑  收藏  举报