/p>
"http://www.w3.org/TR/html4/strict.dtd">
function uuid() {
var s = [];
var hexDigits = "0123456789abcdefghijklmnopq";
for (var i = 0; i < 6; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
var uuid = s.join("");
document.getElementById("ic").value=uuid;
}
function MathRand()
{
var Num="";
for(var i=0;i<6;i++)
{
Num+=Math.floor(Math.random()*10);
}
document.getElementById("ic").value=Num;
}
function createInviteCode() {
var randomChar = Math.random().toString(16).substr(9);
document.getElementById("ic").value=randomChar;
}
原文:http://www.cnblogs.com/ipetergo/p/6650554.html