How do I generate a number after a button is clicked?
Possible Duplicate:
How to create a GUID / UUID in Javascript?
I need to have a script that generates random numbers and letters with a form that looks like this:
M3KRT-CKKYV-YH4G4-YXP42-46FMT
Prefer jQuery, or javascript. I know how to generate number when the button is click using the .click()
method in jQuery. But I can not find out how to actually make the code :(
像这样:在JavaScript中创建GUID / UUID?
为什么你在你的问题中包含Win7许可证密钥?
Modified this example a little:
Create GUID / UUID in JavaScript?
And came up with this:
function S5() {
return (((1 + Math.random()) * 0x100000) | 0).toString(16).substring(1);
}
function guid() {
return (S5() + "-" + S5() + "-" + S5() + "-" + S5() + "-" + S5()).toUpperCase();
}
链接地址: http://www.djcxy.com/p/91396.html
上一篇: PHP函数生成v4 UUID
下一篇: 点击按钮后如何生成数字?