标签:style blog http java color 使用
<script type="text/javascript" language="javascript"> //自定义字典对象 function Dictionary(){ this.data ={}; this.put = function(key,value){ this.data[key] = value; }; this.get = function(key){ return this.data[key]; }; this.remove = function(key){ this.data[key] = null; }; this.isEmpty = function(){ return this.data.length == 0; }; this.size = function(){ return this.data.length; }; } //使用 例子 var d = new Dictionary(); d.put("CN",{id:1,name:‘df‘}); d.put("US", "America"); document.write(d.get("CN").name); document.write(d.get("US")); var dic={}; dic.a=1; dic["b"]={id:1,name:"wqeqweqwewqe"} function get(key){ return dic[key]; } document.write(get("b").name); </script>
标签:style blog http java color 使用
原文地址:http://www.cnblogs.com/wzq806341010/p/3700413.html