首页 > 代码库 > js生成邀请码

js生成邀请码

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title></title>
	</head>	
	<script>		
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=http://www.mamicode.com/uuid;""; 
for(var i=0;i<6;i++) 
{ 
Num+=Math.floor(Math.random()*10); 
} 
document.getElementById("ic").value=http://www.mamicode.com/Num; "ic").value=http://www.mamicode.com/randomChar;"ic" type="text"/>
		<input id="yqmYqm" class="yqm" type="button" value="http://www.mamicode.com/生成邀请码1" onclick="MathRand()"/>	
		<input id="yqmYqm" class="yqm" type="button" value="http://www.mamicode.com/生成邀请码2" onclick="uuid()"/>	
		<input id="yqmYqm" class="yqm" type="button" value="http://www.mamicode.com/生成邀请码3" onclick="createInviteCode()"/>	
	</div>	
	</body>
</html>

  

js生成邀请码