JS生成GUID

<head>
<title>Generate GUID using JavaScript by DevCurry.com</title>
<script type="text/javascript">
function G() {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
}

var guid = (G() + G() + "-" + G() + "-" + G() + "-" + 
G() + "-" + G() + G() + G()).toUpperCase();

alert(guid);
</script>
</head>

你可能感兴趣的:(JS生成GUID)