JS没有枚举
可以用JSON模拟,
如星期:
var week = {};
week.monday = 1;
week.tuesday= 2;
week.wednesday = 3;
week.thursday = 4;
week.friday = 5;
week.saturday = 6;
week.sunday = 7;
var oEnumber={ one:1,
two:2,
three:3
}
alert( oEnumber.one);
JS 中没有枚举, 不过可以用JSON来模拟实现
<head runat="server">
<title>无标题页 </title>
<script type="text/javascript">
var oEnum= {color1:'red',color2: 'white',color3:'black'}
alert( oEnum.color1);
alert( oEnum.color2);
alert( oEnum.color3);
</script>
</head>
<body>
<form id="form1" runat="server">
</form>
</body>
</html>