Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>模拟生成Guid</title>
<script language="javascript" type="text/javascript">
//模拟生成Guid
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 += "-";
}
alert(guid);
}
</script>
</head>
<body>
<input id="Button1" type="button" value="GetGuid" onclick="NewGuid()" />
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>模拟生成Guid</title>
<script language="javascript" type="text/javascript">
//模拟生成Guid
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 += "-";
}
alert(guid);
}
</script>
</head>
<body>
<input id="Button1" type="button" value="GetGuid" onclick="NewGuid()" />
</body>
</html>